The document outlines the creation of several database tables for a university system, including STUDENT, COURSE, ENROLLED, PROFESSOR, DEPARTMENT, SECTION, TEACHES, DORM, and STAY. Each table is defined with its respective attributes, primary keys, and foreign key relationships to establish connections between entities. The structure supports various relationships such as one-to-many and many-to-many, ensuring data integrity and organization within the database.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
11 views4 pages
Bilkent University Relational Schema
The document outlines the creation of several database tables for a university system, including STUDENT, COURSE, ENROLLED, PROFESSOR, DEPARTMENT, SECTION, TEACHES, DORM, and STAY. Each table is defined with its respective attributes, primary keys, and foreign key relationships to establish connections between entities. The structure supports various relationships such as one-to-many and many-to-many, ensuring data integrity and organization within the database.
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4
CREATE TABLE STUDENT
( SID integer NOT NULL,
NAME char(50), CGPA real, DID char(10) NOT NULL, -- one-to-many Study_in relationship merged here and NOT NULL because of total participation Advisor_PID integer NOT NULL, -- one-to-many Advise relationship merged here and NOT NULL because of total participation Primary key(SID) , Foreign key(Advisor_PID) references Professor, Foreign key(DID) references Department)
CREATE TABLE COURSE
( CID char(10) NOT NULL, NAME char(50), Credit integer, Primary key(CID) )
( PID integer NOT NULL, NAME char(50), Specialty char(50), Work_DID char(10) NOT NULL, -- one-to-many Works_in relationship merged here and NOT NULL because of total participation Primary key(PID) , Foreign key(Work_DID) references DEPARTMENT)
CREATE TABLE DEPARTMENT
( DID char(10) NOT NULL, NAME char(50), Budget real, Chair_PID integer NOT NULL, -- one-to-one HOD relationship merged here and NOT NULL because of total participation Primary key(DID) , Unique (Chair_PID) NOT NULL, -- to ensure one-to-one and NOT NULL because it is a candidate key Foreign key(Chair_PID) references PROFESSOR)