Yurttas/PL/DBL/mssql/F/01/Bank/q111.sql
Jump to navigation
Jump to search
1/*
2REM
3REM q111.sql
4REM
5REM Find all customers who have an account at all branches
6REM located in 'Brooklyn'.
7REM
8*/
9
10/*
11
12 MINUS is not implemented this won't work.
13
14*/
15
16SELECT DISTINCT S.customername
17FROM Depositor S
18WHERE NOT EXISTS ((SELECT branchname
19 FROM Branch
20 WHERE branchcity = 'Brooklyn')
21 MINUS
22 (SELECT T.branchname
23 FROM Depositor T
24 WHERE S.customername = T.customername));