Docsity

Database Design for Summer Olympics: Entity-Relationship Diagram and Constraints - Prof. A, Assignments of Principles of Database Management

Toggle sidebar
bg1
CMSC424: Homework 1
Due: Sept 16, 2008
1. The database design process we discussed in the class was:
information/application requirements →entity-relationship model
→relational model →physical data model
Given that both entity-relationship model and relational model are essentially abstractions of reality
and both can be used to model a database, would it make sense to switch the two in the above process
? Why not ?
,
Answer: Solution: No. E-R model is at a higher level of abstraction and closer to the application
requirements than the relational model. It has more concepts, and its intuitive diagrammatic represen-
tation make it easier from humans to work with it. Relational model is closer to the on-disk represen-
tation of the data, and lends itself to much easier implementation. Having only one abstract concept,
relation, also makes it hard to directly build relational schemas from the application requirements.
2. You are asked to design a database that for storing information about the Summer Olympics, the
sports, who won the medals, when the events were conducted, the results etc. Construct an E/R
diagram for this database.
Possible entity sets include: Country, Player, Event etc. Make any simplifying assumptions you need
to make (and state them). You should have about 5-6 entity sets.
Some things you need to model, and watch out for:
•Many events have prelinimary “heats” (e.g. 100m), and there should be a way to model this
information.
•Several of the events are “team” events, with the size of the team usually being 4, and all of
them are awarded the same medal; however more medals might be awarded if the team members
participating in the heats differ from the team members participating in the final.
•You should be able to answer questions like “what was the progression of winning times over
last 100 years for 200m running” ?
Take a look at this website for more information about types of data that needs to be stored
(http://www.databaseolympics.com/).
Answer: Diagram on the next page.
3. Chapter 6.3.3 discusses what are called participatory constraints.
Write down a relationship in the above E/R diagram where you might want to add such a constraint.
Answer: The player-country relationship is participatory; there are many others.
4. Discuss whether your E/R model enforces the constraint that, say in 100m running, the “time” for
GOLD medalist in an event must be smaller than the “time” for the SILVER medalist. Suggest a way
this can be done, if not.
Answer: There is no easy way to do this, especially since the information is stored with two different
entities (two tuples in the table). One possibility: for the silver and bronze medalist (and other non-
gold players), store the difference from the winning time, and force this difference to be positive. This
however forces you to retrieve two tuples to find the time for the silver medalist.
pf3

Partial preview of the text

Download Database Design for Summer Olympics: Entity-Relationship Diagram and Constraints - Prof. A and more Assignments Principles of Database Management in PDF only on Docsity!

CMSC424: Homework 1

Due: Sept 16, 2008

  1. The database design process we discussed in the class was:

information/application requirements → entity-relationship model → relational model → physical data model

Given that both entity-relationship model and relational model are essentially abstractions of reality and both can be used to model a database, would it make sense to switch the two in the above process ? Why not? , Answer: Solution: No. E-R model is at a higher level of abstraction and closer to the application requirements than the relational model. It has more concepts, and its intuitive diagrammatic represen- tation make it easier from humans to work with it. Relational model is closer to the on-disk represen- tation of the data, and lends itself to much easier implementation. Having only one abstract concept, relation, also makes it hard to directly build relational schemas from the application requirements.

  1. You are asked to design a database that for storing information about the Summer Olympics, the sports, who won the medals, when the events were conducted, the results etc. Construct an E/R diagram for this database. Possible entity sets include: Country, Player, Event etc. Make any simplifying assumptions you need to make (and state them). You should have about 5-6 entity sets. Some things you need to model, and watch out for: - Many events have prelinimary “heats” (e.g. 100m), and there should be a way to model this information. - Several of the events are “team” events, with the size of the team usually being 4, and all of them are awarded the same medal; however more medals might be awarded if the team members participating in the heats differ from the team members participating in the final. - You should be able to answer questions like “what was the progression of winning times over last 100 years for 200m running”?

Take a look at this website for more information about types of data that needs to be stored (http://www.databaseolympics.com/). Answer: Diagram on the next page.

  1. Chapter 6.3.3 discusses what are called participatory constraints.

Write down a relationship in the above E/R diagram where you might want to add such a constraint. Answer: The player-country relationship is participatory; there are many others.

  1. Discuss whether your E/R model enforces the constraint that, say in 100m running, the “time” for GOLD medalist in an event must be smaller than the “time” for the SILVER medalist. Suggest a way this can be done, if not. Answer: There is no easy way to do this, especially since the information is stored with two different entities (two tuples in the table). One possibility: for the silver and bronze medalist (and other non- gold players), store the difference from the winning time, and force this difference to be positive. This however forces you to retrieve two tuples to find the time for the silver medalist.

Heat

population^ Country

country-id

area

Name

Olympics

startdate oly-id

enddate

city Event

event-id (^) name is-team- event

Of

Held In

Held At

participant-id

parent child

date

Participates

result medal-if- any

Player birthdate

name Team

Participant

IsA

Part height Of weight

Notes:

  1. Does not model which players in a team participated in which heats. Can be done through an aggregation of "PartOf" relationship.
  2. Medals can only be awarded if an event does not have a "next" event.
  3. "Held In", "Of" are many-to-many. Same player might participate for two different countries in two different years.
  4. An event may have many heats, which themselves have a recursive hierarchical relationship (parent-child).

result- measured-in

Has

heat-id

Figure 1: Example ER Diagram