create table Deparment(
dName char(20) primary key,
dTele char(11) not null,
tNo char(10) not null,
tName char(20) not null
);
create table teacher(
tNo char(10) primary key,
tName char(20) not null,
tSex char(2) check (tSex in('男','女')),
tDuty char(20) check (tDuty in('助教','讲师','副教授','教授')),
cNo char(4)
);
create table course(
cNo char(4) primary key,
cName char(20) not null,
dName char(20) not null,
tNo char(9)
);
create table student(
sNo char(10) primary key,
dName char(10),
sName char(10),
sSex char(2) check(sSex in('男','女')),
sAge int not null,
cName char(20) not null
);
create view S1
as
select sNo,sName,sSex,sAge
from student
WHERE sNo = '160501';
CREATE UNIQUE INDEX studentIndex on student;
CREATE UNIQUE INDEX courseIndex on course;
create procedure st
@studentNo char(4)
as
select *
from student
where student.sNo = @studentNo;