Now, add the required foreign key constraints for each table. Do not add any records yet. Spool your statements and results to the CH4LAB1B.LST file and print it.

What will be an ideal response?


ALTER TABLE student
ADD CONSTRAINT student_facultyid_fk FOREIGN KEY (FacultyId)
REFERENCES faculty (FacultyId);

ALTER TABLE student
ADD CONSTRAINT student_majorid_fk FOREIGN KEY (MajorId)
REFERENCES major (MajorId);

ALTER TABLE student
ADD CONSTRAINT student_startterm_fk FOREIGN KEY (StartTerm)
REFERENCES term (TermId);

ALTER TABLE faculty
ADD CONSTRAINT faculty_roomid_fk FOREIGN KEY (RoomId)
REFERENCES location (RoomId);

ALTER TABLE faculty
ADD CONSTRAINT faculty_deptid_fk FOREIGN KEY (DeptId)
REFERENCES department (DeptId);

ALTER TABLE crssection
ADD CONSTRAINT crssection_courseid_fk FOREIGN KEY (CourseId)
REFERENCES course (CourseId);

ALTER TABLE crssection
ADD CONSTRAINT crssection_termid_fk FOREIGN KEY (TermId)
REFERENCES term (TermId);

ALTER TABLE crssection
ADD CONSTRAINT crssection_facultyid_fk FOREIGN KEY (FacultyId)
REFERENCES faculty (FacultyId);

ALTER TABLE crssection
ADD CONSTRAINT crssection_roomid_fk FOREIGN KEY (RoomId)
REFERENCES location (RoomId);

ALTER TABLE registration
ADD CONSTRAINT registration_studentid_fk FOREIGN KEY (StudentId)
REFERENCES student (StudentId);

ALTER TABLE registration
ADD CONSTRAINT registration_csid_fk FOREIGN KEY (CsId)
REFERENCES crssection (CsId);

ALTER TABLE location
ADD CONSTRAINT location_roomtype_fk FOREIGN KEY (RoomType)
REFERENCES ROOM (RoomType);

Computer Science & Information Technology

You might also like to view...

What if all the edge weights are halved?

If all the edge weights of graph G shown in Figure 9.1 are doubled, what effect will it have on
the following?
(a) The graph frequencies.
(b) The graph harmonics.
(c) The GFT coefficients of a graph signal.

Computer Science & Information Technology

A multimap is implemented to efficiently locate all values paired with a given ____________.

Fill in the blank(s) with the appropriate word(s).

Computer Science & Information Technology

The acronym TCP/IP stands for Transmission Controller Protocol/Intercommunication Protocol. True or False?

Indicate whether the statement is true or false

Computer Science & Information Technology

A computer’s output on the monitor is calibrated to display an image:

a. smaller than the actual monitor’s capability. b. larger than the actual monitor’s capability. c. exactly the same size as the actual monitor’s capability. d. that adjusts automatically to the monitor’s capability. e. of a fixed size, whether it is larger or smaller than the monitor’s capability depends on the monitor.

Computer Science & Information Technology