Sie sind auf Seite 1von 4

SOFTENG 351

Fundamentals of Database Systems

Strategic Exercise 5 - Model Answers

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.

– Supplier = {supplier no, name, address}


– Article = {article no, short name, number on stock, price}
– Department = {department no, budget}
– Client = {client no, name, address}
– Bill = {bill no, amount}
– Offer = {supplier no, article no, date, price}
[supplier no] ⊆ Supplier[supplier no] and
[article no] ⊆ Article[article no]
– Purchase = {supplier no, article no, department no, date, quantity}
[supplier no] ⊆ Supplier[supplier no] and
[article no] ⊆ Article[article no] and
[department no] ⊆ Department[department no]
– Sale = {client no, article no, department no, bill no, date, price}
[client no] ⊆ Client[client no]
[article no] ⊆ Article[article no]
[department no] ⊆ Department[department no]
[bill no] ⊆ Bill[bill no]

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

contribution + credits • credits


)
•  R

Crew Director Role Writer



• •Y description •

j U   )
–title
Restriction • -
Movie –production year
–country

• major genre run time
6

Appearance
? no • description •
Restriction –description
–country
Scene 9
Category

Das könnte Ihnen auch gefallen