Chapter 3

A1:
Insert into employee (last_name, first_name, payroll_number, 
fk_department, Social_security_number, gender, current_position, 
wages, birth_date, 
 Employment_date, phone, state, street, city) 
Values (‘QUAYLE’,‘DAN’, 50,‘INT’, 312-33-9089,‘M’, 
 ‘CHIEF EXECUTIVE’, 50000,‘09-MAR-42’, 
 to_date(‘20-JAN-2001’,‘DD-MON-YYYY’), 
 ‘712-345-9876’,‘IN’,‘1234 WESTERN’, ‘INDIANAPOLIS’); 
A2:
Insert into glasses (fk_payroll_number, purchase_date, optician, 
cost) select payroll_number,‘07-MAY-2001’,‘Pearl Optical’, 78 
from employee 
where fk_department = ‘WEL’; 
A3:
Update employee set wages = (wages*1.03); 
Update employee set wages = wages + 900 
 where fk_department = ‘WEL’; 
A4:
delete from glasses; 
A5:
rollback; 

Get Oracle SQL and PL/SQL Handbook: A Guide for Data Administrators, Developers, and Business Analysts now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.