Relational Schema
Translate the E/R diagram into an “equivalent” relational schema in SQL
(the data definition language, DDL). Do not create any tables that are not needed.
Declare primary keys and foreign keys per table appropriately to capture the logic of the E/R diagram correctly.
Choose appropriate domain types — integer, date, varchar(…), etc. — as
is appropriate.
Key attributes in the E/R diagram should be declared as
not nullable.
For attribute and table names, carry over those from the E/R diagram where you can,
and make sensible choices where you cannot.
The Data
Fill your tables with data. You are free to choose any data you like.
However, you must make sure that the query you run on your database (see below)
returns at least one tuple.
The Query
List all courses taken by John Malkovich in 2017/18 together with their instructors,
times, and locations. Since you make up your own data your answer can be completely arbitrary.
| |