| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1752 人关注过本帖
标题:帮忙检查一下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
快速回复:帮忙检查一下SQL语句,我实在是找不到哪里错了、
数据加载中...
 
   



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

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