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

Info icon This 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,
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

  • Spring '10
  • Jack
  • Foreign key, CONSTRAINT term_status_cc CHECK, CONSTRAINT course_section_cid_fk FOREIGN, CONSTRAINT course_section_loc_id_fk FOREIGN, CONSTRAINT course_section_termid_fk FOREIGN

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern