
Note: Questions marked with an asterisk are substantially different from the corresponding questions in the text. Relatively minor clarifications and additions to the other questions are in brackets.
| course ( c-num, title, credits ) |
| course-offering ( c-num, sec-num, semester, instructor, room, time ) |
| student ( name, id-num, major ) |
| enroll ( c-num, sec-num, semester, id-num, grade ) |
Give an SQL DDL definition of this database. Choose domains for the attributes that would be suitable for the values used at Fordham, e.g. for c-num like CSLU3500 and so forth. Identify referential-integrity constraints that should hold, and include them in the DDL definition. (For ``real'' SQL, you can change all hyphens to underscores.)
| salaried-worker ( name, office, phone, salary ) |
| hourly-worker ( name, hourly-wage ) |
| address ( name, street, city ) |
Here, employee-name is a key to the table manager, meaning that each employee has at most one manager. The foreign-key clause requires that every manager also be an employee [who is managed, i.e., a subordinate]. Explain exactly what happens when a tuple in the relation manager is deleted. [That is, what steps must the system take to check the referential-integrity constraint and to maintain consistency if it is violated? Give an example, using a small instance of the manager table (with 4 or 5 rows), showing the sequence of steps that would occur following deletion of one row.]