unity3D—列的基本操作和约束
来源:互联网 发布:win7编程界面 编辑:程序博客网 时间:2024/05/29 16:28
列的基本操作:
1.添加一列:
alter table 表名 add 列名 类型(长度) null
--alter table teacher add age int null
2.更改一列类型:
Alter table 表名 alter column 列名 数据类型(长度)
column:列
--alter table teacher alter column age int
3.删除一列:
alter table 表名 drop column 列名
--alter table teacher drop column age
4.主键约束:
alter table 表名 add constraint 主键别名 primary key (主键列)
--alter table teacher add constraint aw primary key(id)
5.唯一键约束:
alter table 表名 add constraint 唯一键别名 unique (唯一键列)
--alter table teacher add constraint ap unique(name)--
6..默认键约束:
alter table 表名 add constraint 默认键别名
default (‘默认值’) for 默认键
--alter table teacher add constraint t_ de default('男') for sex
7.检查键约束:
alter table 表名 add constraint 检查键别名
check(stuAge>=15 and stuAge<=40)
alter table teacher add constraint ae check(age>=15 and age<=40)
8.删除约束:
alter table 表名 drop constraint 约束别名
--alter table score drop constraint ae
9. 为teacher和users表添加主外关联:
--Alter table score add constraint es foreign key(uid) references users(id)
-- insert into score(id,grade,uid) values(1,85,110)
顺便简单介绍下ArrayList和List的用法
ArrayList 很类似数组,但是ArrayList 类没有固定大小;可以根据需要不断增长默认大小为16个元素,当添加第17个元素时会自动扩展到32个可以显式地指定其容量可以存储不同类型的元素, 因为所有ArrayList中的元素都是对象(System.Object)
加上using System.Collection
ArrayList al = new ArrayList();
int a=new int[6] { 9, 3, 7, 2, 4, 8 }
al.Add(100);//单个添加
foreach (int number in a)
{
al.Add(number);//集体添加
}
List:泛型集合可以约束集合内的元素类型,编译时检查类型约束,无需装箱拆箱操作
加上using System.Collections.Generic;
List<string> list=new List<string>();
List<Person> list = new List<Person>();
更多精彩可以关注:http://www.gopedu.com/
- unity3D—列的基本操作和约束
- Unity3D学习之(列的基本操作和约束以及泛型集合)
- 学习Unity3D之列的基本操作、约束和ArrayList类。
- 列的基本操作,约束和集合的ArrayList类
- unity之列的基本操作和约束
- Unity之列的基本操作和约束
- 数据库列的基本操作和约束,C#集合的学习
- 数据库列的基本操作
- unity3D—SQL基本操作
- unity学习之列的基本操作和集合
- ISE 约束文件的基本操作
- SQL表的创建和基本约束
- 列级约束和表级约束
- 自增列的基本操作
- 数据结构中队列的基本操作实现
- 散列操作的基本例程(1)
- 数据库的基本操作之多列添加
- unity3d---数据库基本操作
- unity之集合
- MFC俄罗斯方块增加多彩方块,闪烁消行
- 项目经验分享——Java常用工具类集合
- Perl--引用<1>
- 后缀数组
- unity3D—列的基本操作和约束
- 第七章 查找技术
- Redis整理(5)之数据类型list
- redis
- asp.net中FileUpload控件研究汇总
- JAX-RS
- 优化内存分配
- 12-10java面向对象之static关键字
- DICOM医学图像处理:深入剖析Orthanc的SQLite,了解WADO & RESTful API