Added on -2019-09-21

| 3 pages
| 466 words

Trusted by 2+ million users,
1000+ happy students everyday

Showing pages 1 to 1 of 3 pages

CREATE TABLE Student( Student_ID Number(8) PRIMARY KEY, Name Varchar2(15) NOT NULL, Mobile Varchar2(8), Birth_date Date, Dept_ID char(4) NOT NULL, Major Varchar2(3), Nationality Varchar2(20) NOT NULL, Course_ID Varchar2(8) NOT NULL, Grades Varchar2(2), Gender Char(1) NOT NULL, CONSTRAINT student_gender_ck CHECK(Gender='M' OR Gender='F'), CONSTRAINT student_deptid_fk FOREIGN KEY(Dept_ID) REFERENCES Departement(Dept_ID), CONSTRAINT student_courseid_fk FOREIGN KEY(Course) REFERENCES Course(Course_ID));CREATE TABLE Semester( Semester_ID Varchar2(8) NOT NULL, Course_ID Varchar2(8) NOT NULL, CONSTRAINT semester_id_pk PRIMARY KEY(Semster_ID), CONSTRAINT semester_courseid_fk FOREIGN KEY (Course_ID) REFERENCES Course(Course_ID));CREATE TABLE Course( Course_ID Varchar2(8) PRIMARY KEY, Course_name varchar2(10), Crdt_hrs varchar(3), Prerequisite varchar(10), CONSTRAINT course_prereq_ck CHECK(count(Prerequisite)<=3) --CHECK! --CONSTRAINT course_m CHECK PASSED PREQUISITES!);CREATE TABLE Departement( Dept_ID char(4) PRIMARY KEY, Dept_name Varchar2(20) NOT NULL, College_ID Varchar2(3), CONSTRAINT departement_collegeid_fk FOREIGN KEY (College_ID) REFERENCES College(College_ID));

Found this document preview useful?

You are reading a preview
Upload your documents to download
Become a Desklib member to get accesss

Students who viewed this