DROP TABLE instructor;
DROP TABLE course;
CREATE TABLE instructor (
insid INTEGER PRIMARY KEY,
lname VARCHAR(32) NOT NULL,
office_no VARCHAR(16),
ext INTEGER );
INSERT INTO instructor VALUES( 309, 'O''Neil', 'S-3-223', 78543 );
INSERT INTO instructor VALUES( 123, 'Regen', 'S-3-547', 78413 );
INSERT INTO instructor VALUES( 113, 'Smith', 'S-3-115', 78455 );
...
CREATE TABLE course (
cid INTEGER PRIMARY KEY,
insid INTEGER,
name VARCHAR(32) NOT NULL,
room VARCHAR(16),
period VARCHAR(16),
FOREIGN KEY ( insid ) REFERENCES instructor( insid ) );
INSERT INTO course VALUES( 120, 309, 'CS240', 'M-1-213', 'MW6' );
INSERT INTO course VALUES( 940, 309, 'CS630', 'M-1-214', 'MW7:30' );
INSERT INTO course VALUES( 453, 123, 'CS632', 'M-2-614', 'TTH6' );
...
|