Académique Documents
Professionnel Documents
Culture Documents
Entity-Relationship Modeling
Exercise 1. Translate the ER diagram from the last page into its corresponding relational
database schema. For each relation schema make explicit the set of attributes, the key, and
the foreign keys.
Exercise 2. For the following relational database schema, its corresponding ER diagram is
attached to the last page.
Movie
attributes : title, production year, country, run time, major genre
primary key : title, production year
Person
attributes : id, first name, last name, year born
primary key : id
Award
attributes : name, institution, country
primary key : name
1
Restriction Category
attributes : description, country
primary key : description, country
Director
attributes : id, title, production year
primary key : title, production year
foreign keys : [title, production year] ⊆ Movie[title, production year]
[id] ⊆ Person[id]
Writer
attributes : id, title, production year, credits
primary key : id, title, production year
foreign keys : [title, production year] ⊆ Movie[title, production year]
[id] ⊆ Person[id]
Crew
attributes : id, title, production year, contribution
primary key : id, title, production year
foreign keys : [title, production year] ⊆ Movie[title, production year]
[id] ⊆ Person[id]
Role
attributes : id, title, production year, description, credits
primary key : title, production year, description
foreign keys : [title, production year] ⊆ Movie[title, production year]
[id] ⊆ Person[id]
Scene
attributes : title, production year, scene no, description
primary key : title, production year, scene no
foreign keys : [title, production year] ⊆ Movie[title, production year]
Restriction
attributes : title, production year, description, country
primary key : title, production year, description, country
foreign keys : [title, production year] ⊆ Movie[title, production year]
[description, country] ⊆ Restriction Category[description, country]
Appearance
attributes : title, production year, description, scene no
primary key : title, production year, description, scene no
foreign keys :
[title, production year, description] ⊆ Role[title, production year, description]
[title, production year, scene no] ⊆ Scene[title, production year, scene no]
2
Movie Award
attributes : title, production year, award name, year of award,
category, result
primary key : title, production year, award name, year of award, category
foreign keys : [title, production year] ⊆ Movie[title, production year]
[award name] ⊆ Award[name]
Crew Award
attributes : id, title, production year, award name, year of award,
category, result
primary key : id, title, production year, award name, year of award, category
foreign keys : [id, title, production year] ⊆ Crew[id, title, production year]
[award name] ⊆ Award[name]
Director Award
attributes : title, production year, award name, year of award,
category, result
primary key : title, production year, award name, year of award, category
foreign keys : [title, production year] ⊆ Director[title, production year]
[award name] ⊆ Award[name]
Writer Award
attributes : id, title, production year, award name, year of award,
category, result
primary key : id, title, production year, award name,
year of award, category
foreign keys :
[id, title, production year] ⊆ Writer[id, title, production year]
[award name] ⊆ Award[name]
Actor Award
attributes : title, production year, description, award name,
year of award, category, result
primary key : title, production year, description, award name,
year of award, category
foreign keys :
[title, production year, description] ⊆ Role[title, production year, description]
[award name] ⊆ Award[name]
3
name country
year category –id
Recipient
Award • Awarded • ⊕
-
Person –first name
–last name
result : 13
6
–year born
institution
j U )
–title
Restriction • -
Movie –production year
–country
•
• major genre run time
6
Appearance
? no • description •
Restriction –description
–country
Scene 9
Category