SQL创建表
时间:2011-03-29 来源:范成聪
/*创建表*/
create table Student
(
Sno char(9) primary key,
Sname char(20) unique,
Ssex char(2),
Sage Smallint,
Sdept char(20)
)
/*********/
create table Course
(
Cno char(4) primary key,
Cname char(40),
Cpno char(4),
Ccredit smallint,
foreign key (Cpno) references Course(Cno)
)
/*********/
create table SC
(
Sno char(9),
Cno char(4),
Greade smallint,
primary key(Sno,Cno),
foreign key(Sno) references Student(Sno),
foreign key(Cno) references Course(Cno)
)
相关阅读 更多 +