Yurttas/PL/DBL/oracle/F/01/Company-B/q08.sql
1REM
2REM q08.sql
3REM
4REM Assume the companies may be located in several cities.
5REM Find all companies located in every city in which
6REM 'Small Bank Corporation' is located.
7REM
8
9SELECT DISTINCT C1.companyname
10FROM Company C1
11WHERE NOT EXISTS
12 (SELECT city
13 FROM Company
14 WHERE companyname='Small Bank Corporation'
15 AND city NOT IN (SELECT C2.city
16 FROM Company C2
17 WHERE C1.companyname = C2.companyname))
18 AND C1.companyname <> 'Small Bank Corporation';