帮忙检查一下SQL语句,我实在是找不到哪里错了、
create table T(
TNo char(10 ) primary key ,
TN char( 10 ) not null,
Sex char( 2 ) not null,
Age tinyint not null constraint TAge_chk check( Age>0 and Age<=255 ) , ///提示说是这行有问题,但我找不到错在哪里啊。
Prof char( 10 ),
Sal numeric( 7,2 ),
Comm numeric( 7,2 ),
Dept varchar(15 )
)
create table S
(
SNo char(6 ),
SN char(10 ),
Sex char(2 ),
Age tinyint constraint SAge_chk check( Age>0 and Age<=255 ) ,
Dept varchar( 15 )
)
create table C
(
CNo char(6 ),
CN char(10 ),
CT tinyint
)
create table SC
(
SNo char(6 ) not null,
CNo char( 6 ) not null,
Score numeric(4,1 ),
primary key( SNo,CNo ),
foreign key (SNo ) references S( SNo ),
foreign key( CNo ) references C(CNo ),
constraint Score_chk check( ( Score is null ) or ( Score between 0 and 100 ) )
)
create table TC
(
TNo char( 6 ) not null,
CNo char(6 ) not null,
primary key( TNo, CNo ),
foreign key ( TNo ) references T( TNo ),
foreign key( CNo ) references C( CNo )
)