例3.5建立一个“学生”表student
create table student
(sno char(9) primary key,
sname char(20) unique,
ssex char(2),
sage smallint,
sdept char(20)
);
例3.6建立一个“课程”表course
create table course
(cno char(4) primary key,
cname char(40) not null,
cpno char(4),
ccredit smallint,
foreign key(cpno) references course(cno)
);
例3.7建立学生选课表sc
create table sc
(sno char(9),
cno char(4),
grade smallint,
primary key(sno,cno),
foreign key(sno) references student(sno),
foreign key(cno) references course(cno)
);