Yurttas/PL/DBL/postgres/F/01/SPJ/q050.sql

From ZCubes Wiki
Jump to navigation Jump to search
 1/*
 2REM
 3REM q050.sql
 4REM
 5REM Get project numbers for projects supplied entirely by
 6REM supplier 'S01'.
 7REM
 8*/
 9
10SELECT current_schema();
11SET search_path to "spj";
12
13SELECT J.jn
14FROM Projects J
15WHERE NOT EXISTS (SELECT *
16                  FROM Shipments SPJ
17                  WHERE SPJ.jn = J.jn
18                    AND NOT (SPJ.sn = 'S01'));