标题:帮忙检查一下SQL语句,我实在是找不到哪里错了、
只看楼主
lin_zhong
Rank: 1
等 级:新手上路
帖 子:16
专家分:0
注 册:2012-1-13
结帖率:75%
 问题点数:0 回复次数:1 
帮忙检查一下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 )

)
搜索更多相关主题的帖子: primary create null 
2012-03-08 14:43



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-362554-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.093524 second(s), 7 queries.
Copyright©2004-2025, BCCN.NET, All Rights Reserved