3.17
Consider the employee database of Figure 3.19. Give an expression in SQL for each of the following queries.
- Give all employees for “First Bank Corporation” a 10 percent raise.
- Give all managers of “First Bank Corporation” a 10 percent raise.
- Delete all tuples in the works relation for employees of “Small Bank Corporation”.
- Give all employees for “First Bank Corporation” a 10 percent raise.
UPDATE works
SET salary = salary * 1.1
WHERE company_name = 'First Bank Corporation'
- Give all managers of “First Bank Corporation” a 10 percent raise.
UPDATE works
SET salary = salary * 1.1
WHERE company_name = 'First Bank Corporation' AND id IN (
SELECT manager_id
FROM manages
)
- Delete all tuples in the works relation for employees of “Small Bank Corporation”.
DELETE FROM works
WHERE company_name = 'Small Bank Corporation'