Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Alice has a large DVD movie collection.

Her friends like to borrow her DVD's, and she needs


a way to keep track of who has what. She maintains a list of friends, identified by uniqu FID's
(friend identifiers) and a list of DVD's, identified by DVDID' s (DVD identifiers). With each
friend is the name and the all-important telephone numbers, which she can call to get the
DVD, back. With each DVD is the star actor name and title. Whenever a friend borrows a
DVD, Alice will enter that fact into her database along with the date borrowed. Whenever the
DVD gets returned, that fact, too, gets noted along with the date returned. Alice wants to
keep a complete history of her friends' borrowing habits so that she can ask favors of the
heavy borrowe rs (or perhaps refuse to make further loans to those who habitually don't
return them quickly)
Suppose you are given the following requirements for a simple database fort he National Hockey
Leaguage (NHL):

 The NHL has many teams,


 Each team has a name, a city, a coach, a captain and set of players,
 Each player belongs to only one team,
 Each player has a name, a position (such as left wing), a skill level and if a player has a injury
also a set of injury records (each record has number of event and description attributes),
 A team captain is also a player but a coach is not a player,
 A game is played between two teams (referred as host team and guest team) and has a date
(such as May 11 th 1999) and score (such as 4 to 2).
 If the game have internal problems to play (such as one team not to come a game) the game
is not cancelled and have before decided score and have external problems to play ( such as
earthquake) the game is cancelled and will be updated.
 Each team has 6 players in game.

https://www2.cs.sfu.ca/CourseCentral/354/louie/Chap2_practice_key.pdf (Answer is not enough.)


EXERClSE 2: GAME Scenario

Suppose you are given the following requests for the database design of a sport club:

 The club has many teams.


 Each team has Teamld, TeamName, CoachName and City. The team has a set of players. The
team captain is also a player.
 Each player has PlayerSSN, PlayerName composed of Fname and Lname, Birthday and Position
(left, right ormmiddle). A player belongs to only one team.
 A game is played between two teams and has also a game date, score_host, score_guest. A game
can be canceled by weather conditions or any problem of the game teams. For the same date,
two teams can only play one game but they can play different games on several dates.
 lnjury records of a player are saved with lnjuryType, and Description.
 A player can get one or more injuries and each injury can happen to one or more player(s). Each
injury of a player must be saved into the database with the injury date and time.

Draw the diagram of the ER Model with entities, relationships, relationship types, weak
entitıes/relationships.
The following requests are made to design a database:

 Department is defined with DNo and DName. Their values can not repeat. It has many students.
 Student is defined with Studentld, Name composed of FirstName and LastName. Studentsld is
the identifier. Student is registered in one department only. It has many lecturers.
 Lecturer is defined with SSN(Social Security Number), FName, LName and StaıtDate, She/He can
work in one department only.
 Course is defined with coursecode, courseName and credit. values of coursecode and
courseName can not repeat.
 Student takes a course based on year and Term given by a lecturer and her/his success point is
saved with point at the end of the term.
 Lecturer can give one or more courses and a course can be given by none, one or more lecturers.
 Each department has a manager. A manager must be one of lecturer from department.

We can not decide about the relationship type of N-ary degree relationship such as Take, therefore
we have to convert this relationship to weak entity having 3 binary relationships, which is shown in
the following diagram which is the end stage of ER Model.

You might also like