正在加载图片...
And a Few More Relation Definitions create table student ID varchar(5), name varchar(20) not null. dept name varchar(20), tot cred numeric(3,0), primary key (ID), foreign key (dept_name)references department); create table takes ID varchar(5), course id varchar(8), sec id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2), primary key (ID,course id,sec id,semester,year), foreign key(ID)references student, foreign key (course_id,sec_id,semester,year)references section); Note:sec_id can be dropped from primary key above,to ensure a student cannot be registered for two sections of the same course in the same semester Database System Concepts-6th Edition 3.8 @Silberschatz,Korth and SudarshanDatabase System Concepts - 6 3.8 ©Silberschatz, Korth and Sudarshan th Edition And a Few More Relation Definitions create table student ( ID varchar(5), name varchar(20) not null, dept_name varchar(20), tot_cred numeric(3,0), primary key (ID), foreign key (dept_name) references department); create table takes ( ID varchar(5), course_id varchar(8), sec_id varchar(8), semester varchar(6), year numeric(4,0), grade varchar(2), primary key (ID, course_id, sec_id, semester, year) , foreign key (ID) references student, foreign key (course_id, sec_id, semester, year) references section); Note: sec_id can be dropped from primary key above, to ensure a student cannot be registered for two sections of the same course in the same semester
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有