Yurttas/PL/DBL/postgres/F/01/Company-B/Works-cre.sql

From ZCubes Wiki
Jump to navigation Jump to search
 1/*
 2REM
 3REM
 4REM Works-cre.sql
 5REM
 6REM
 7*/
 8
 9SELECT current_schema();
10SET search_path to "companyb";
11
12CREATE TABLE Works(employeename VARCHAR(16) NOT NULL,
13                   companyname VARCHAR(24) NOT NULL,
14                   salary INTEGER,
15       PRIMARY KEY(employeename, companyname),
16       FOREIGN KEY(employeename) REFERENCES Employee(employeename),
17       FOREIGN KEY(companyname) REFERENCES Company(companyname));