The hardcopy exercises together are worth 70% and the MySQL exercise 30%.
Undergrads and graduate students
Do Exercises 2.4.7, 2.4.8 (undergrad extra credit), 2.5.1(a,b,c) (hardcopy).
MySQL exercise (dropbox): Add the following constraints to your database schema
from Homework2, exercises 2.3.1 and 2.4.1:
Once you are satisfied that you have the correct commands, put them all
in a single file hw3.sql along with the data insertion commands
from HW2. Then try the following
commands in MySQL (assuming the original data was entered exactly as
in Figures 2.20 and 2.21):
insert into Product(maker, model) values('I', 1014);
insert into Product values('J', 4001, 'toaster');
insert into Laptop values (2001, 3.00, 1024, 480, 15.6, 1995);
delete from Product where model=1001;
select * from Printer;
delete from Product where model=3001;
select * from Printer;
rollback;
All the data-altering commands above should be disallowed, with an
error message given, except for the last one, which should also alter the
Printer table instance. Add these commands to the bottom of your
hw3.sql file. Exit MySQL, and at the shell prompt, type
mysql -p -e "source hw3.sql" sales > hw3.txt
Submit a .zip file containing the two files hw3.sql and hw3.txt.
Graduate students only
Do Exercises 2.4.8 (for full credit), 2.5.1(d,e) (hardcopy)