COMP3311 Final Exam 22T3 |
The University of New South Wales COMP3311 Database Systems Final Exam 22T3 |
Database Systems |
Consider the following ER diagram:
Map this ER diagram to two different SQL schemas as follows:
using the ER-style mapping for the subclasses
using the single-table mapping for subclasses
Use the same names as in the diagram. Name foreign keys after the table they refer to. Assume all attributes are of type text, except for id which is an integer primary key. Text attributes can be null; primary and foreign key attributes cannot be null. Every table must have a primary key defined.
To keep things more compact, where possible use the short versions of primary and foreign key definitions, e.g.
attr1 integer references Rel(attr2) -- rather than attr1 integer, ... foreign key (attr1) references Rel(attr2)
Instructions: