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

 1/*
 2REM
 3REM q051.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 SPJ.sn != 'S01');