Databases (HT2012)

Tutorial 4

Creating tables

Returning to the same domain once again, you have identified the following relations:

Write SQL statements that would create these relations as tables. Remember to include all constraints in your tables, including the (somewhat non-ordinary) value constraints given in the schema above.

Also do the following exercises from "Database Systems: The Complete Book, 2/E":

If you have the first edition of the textbook, the following exercises are similar:

Database modifications

Do the following exercises from "Database Systems: The Complete Book, 2/E":

If you have the first edition of the textbook, the following exercises are similar:

Views

With the tables created above, create the views:

Assertions

Also do the following exercises from "Database Systems: The Complete Book, 2/E":

If you have the first edition of the textbook, the following exercises are similar:

Triggers

Write a trigger that, whenever a class is inserted that would collide with another class in the same room, instead schedule that class to be on Someday.

Also do the following exercises from "Database Systems: The Complete Book, 2/E":

If you have the first edition of the textbook, the following exercises are similar:


Last Modified: 26 October 2012 by Graham Kemp