t-sql语句创建表(基础)

create table ta1
(
     id int identity(1,2) not null,
     name nvarchar(20) not null,
     identify varchar(18) primary key,
     birthday datetime not null,
     salary money not null check(salary >=0 and salary <=10000)
)

//简单解释:创建“ta1”表;

“id”列为自动增长数字,初始值为1,增量值为2,不许为空;

“identify”列不允许超过20个字节,不许为空;

“birthday”列数据类型为datetime,不许为空;

“salary”列数据类型为money,不许为空,并且数值范围大于等于0,小于等于10000

//如果大家有对语句中的函数,有疑问的,可以到我的另一篇博客解惑

sqlserver常用数据类型(精炼版) - join-乔颖 - 博客园
https://www.cnblogs.com/joinbestgo/p/10543763.html

猜你喜欢

转载自www.cnblogs.com/joinbestgo/p/10543875.html