CREATE
TABLE
CORPREPORTERINFO(
CRID
NUMBER
NOT
NULL,
CORPID
VARCHAR2(8)
NOT
NULL,
CRNAME
VARCHAR2(20),
PRIMARY
KEY(CRID,CORPID)
)
TABLESPACE
"AGR"
COMMENT
ON
table
CORPREPORTERINFO
IS
'上报员表'
添加字段雀拆注释:
comment
on
column
CORPREPORTERINFO.CRID
is
'id'
comment
on
column
CORPREPORTERINFO.CORPID
is
'企圆岁宽业id'
comment
on
column
CORPREPORTERINFO.CRNAME
is
'名称'
建表sql语句如下:
--创建学昌掘员信息数册盯据表州迅和use 所用数据库名
go
if exists (select * from sysobjects where name='Students')
drop table Students
go
create table Students
(
StudentId int identity(100000,1) , --主键
StudentName varchar(20) not null,
Gender char(2) not null,
Birthday smalldatetime not null,
StudentIdNo numeric(18,0) not null,--身份z号
StudentAddress varchar(500)
)
go
--创建数据表的各种约束
use 所用数据库名
go
--创建“主键”约束primary key
if exists(select * from sysobjects where name='pk_StudentId')
alter table Students drop constraint pk_StudentId
alter table Students add constraint pk_StudentId primary key (StudentId)
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)