126 Create
tabe Course.
create table class
( classid Integer,
courseID integer,
instID char(9),
semester integer,
days char(3) not
null,
times char(8) not
null,
room integer not
null,
cap integer not
null,
constraint
class_classID_PK primary key (classID),
constraint
class_couseID_FK Foreign Key (courseID) references course (courseID),
constraint
class_InstID_FK Foreign Key (instID) references instructor (InstID),
constraint
class_room_FK Foreign key (room) references classrooms (classroom),
constraint
class_days_CK check (days in ('MWF','MW','TR')),
constraint
class_times_CK check ((days in ('MWF') and times in ('
or (days = 'MW' and
times in ('
or (days = 'TR' and
times in ('
constraint
class_cap_ck check (cap > 0),
unique(instid,days,times),
unique(room,days,times));