Yurttas/PL/DBL/mssql/F/01/Bank/q110.sql
Revision as of 04:26, 3 November 2013 by MassBot1 (talk | contribs) (Created page with "<syntaxhighlight lang="sql" line start="1" enclose="div">→REM REM q110.sql REM REM Find all customers who have an account at all branches REM located in 'Brooklyn'. REM: ...")
1/*
2REM
3REM q110.sql
4REM
5REM Find all customers who have an account at all branches
6REM located in 'Brooklyn'.
7REM
8*/
9
10SELECT DISTINCT S.customername
11FROM Depositor S
12WHERE NOT EXISTS
13 (SELECT branchname
14 FROM Branch
15 WHERE branchcity = 'Brooklyn'
16 AND branchname NOT IN (SELECT T.branchname
17 FROM Depositor T
18 WHERE S.customername = T.customername));