Yurttas/PL/DBL/postgres/F/01/Company-B/q16.sql

 1/*
 2REM
 3REM q16.sql
 4REM
 5REM Give all managers a 10 percent raise unless the 
 6REM salary becomes greater than $100,000. In such cases,
 7REM give only a 3 percent raise.
 8REM
 9*/
10
11SELECT current_schema();
12SET search_path to "companyb";
13
14UPDATE Works
15SET salary = salary * 1.03
16WHERE employeename IN (SELECT managername
17                       FROM manages)
18  AND salary * 1.1 > 100000;
19
20UPDATE Works
21SET salary = salary * 1.1
22WHERE employeename IN (SELECT managername
23                       FROM manages)
24  AND salary * 1.1 <= 100000;