2Case2 - loc_id NUMBER(6 max_enrl NUMBER(4 CONSTRAINT...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
-- script to create part of NORTHWOODS database structure -- BMIS441 --File name: 2Case2.sql --created 9/11/2006 Jason Chen, Row:1 - CREATE TABLE TERM (term_id NUMBER(6), term_desc VARCHAR2(20), status VARCHAR2(20), start_date DATE, CONSTRAINT term_term_id_pk PRIMARY KEY (term_id), CONSTRAINT term_status_cc CHECK ((status = 'OPEN') OR (status = 'CLOSED'))); C CREATE TABLE COURSE (course_no VARCHAR2(7), course_name VARCHAR2(25), credits NUMBER(2), CONSTRAINT course_course_id_pk PRIMARY KEY(course_no)); C CREATE TABLE COURSE_SECTION (c_sec_id NUMBER(6), course_no VARCHAR2(7) CONSTRAINT course_section_courseid_nn NOT NULL, term_id NUMBER(6) CONSTRAINT course_section_termid_nn NOT NULL, sec_num NUMBER(2) CONSTRAINT course_section_secnum_nn NOT NULL, f_id NUMBER(6), c_sec_day VARCHAR2(10), c_sec_time DATE, c_sec_duration INTERVAL DAY TO SECOND,
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: loc_id NUMBER(6), max_enrl NUMBER(4) CONSTRAINT course_section_maxenrl_nn NOT NULL, CONSTRAINT course_section_csec_id_pk PRIMARY KEY (c_sec_id), CONSTRAINT course_section_cid_fk FOREIGN KEY (course_no) REFERENCES course(course_no), c CONSTRAINT course_section_loc_id_fk FOREIGN KEY (loc_id) REFERENCES location(loc_id), CONSTRAINT course_section_termid_fk FOREIGN KEY (term_id) REFERENCES term(term_id), CONSTRAINT course_section_fid_fk FOREIGN KEY (f_id) REFERENCES faculty(f_id)); C CREATE TABLE ENROLLMENT (s_id VARCHAR2(6), c_sec_id NUMBER(6), grade CHAR(1), CONSTRAINT enrollment_pk PRIMARY KEY (s_id, c_sec_id), CONSTRAINT enrollment_sid_fk FOREIGN KEY (s_id) REFERENCES student(s_id), CONSTRAINT enrollment_csecid_fk FOREIGN KEY (c_sec_id) REFERENCES course_section (c_sec_id)); (...
View Full Document

This note was uploaded on 03/26/2010 for the course ITS 26 taught by Professor Jack during the Spring '10 term at Staten Island.

Ask a homework question - tutors are online