Yurttas/PL/DBL/postgres/F/01/Movies/Movie-cre.sql

 1/*
 2REM
 3REM
 4REM Movie-cre.sql
 5REM
 6REM
 7*/
 8
 9SELECT current_schema();
10SET search_path to "movies";
11
12CREATE TABLE Movie(title VARCHAR(24) NOT NULL,
13                   year INTEGER NOT NULL,
14                   length INTEGER,
15                   filmtype VARCHAR(5),
16                   studioname VARCHAR(36) NOT NULL,
17                   producercn INTEGER NOT NULL,
18       PRIMARY KEY(title, year),
19       FOREIGN KEY(studioname) REFERENCES Studio(name),
20       FOREIGN KEY(producercn) REFERENCES MovieExec(cn));