e r Modeling

download e r Modeling

of 7

description

database

Transcript of e r Modeling

EXERCISE FOR TOPIC 4 E-R MODELING

EXERCISE FOR TOPIC 4 E-R MODELING

QUESTION 1

Diagram 1 below shows a relationship between two tables. Explain the relationship between the two tables.

Diagram 1

CUSTOMER is mandatory. This condition is created by constraint imposed by the semantics of the statement Each HOTEL accommodates one or more customers.In ER terms, each HOTEL in the accommodates relationship must have at least one customer.Therefore, a CUSTOMER must be existed as the HOTEL is existed to comply with the semantics of the problems.

QUESTION 2

Diagram 2Identify the differences between diagram 1 and diagram 2.

ROOM share the primary key of HOTEL which is Hotel_ID as a foreign key.

QUESTION 3

Diagram 3Based on the above diagram explain the functions of the following icons:a) Datasheet ViewAdd the information for a new record and edit an existing record.

b) Design ViewShows the design of the table such as list of attributes, data types and descriptions.

c) Primary KeyEnables each record to be unique without ambiguity.

d) Property sheetCreates a property sheet and adds pages defined in the specified property sheet header structure.

QUESTION 4

Diagram 4Based on the above diagram explain how to establish a relationship between table Booking and table Guest.Click on the [Enforce Referential Integrity] and it will show a [/] in the box. After that click on the [Create] button and the one-to-many relationship established.

QUESTION 5

Diagram 5Based on the above diagram, answer the following questions.a) Identify the mistakes from the above diagramThe table BOOKING and table GUEST did not share the same query.

b) Suggest the appropriate entity relationship diagramThe table BOOKING and table GUEST should share GUESTID as the same query.

QUESTION 6The local city youth league needs a database system to help track children who sign up to play soccer. Data need to be kept on each team and the children who will be playing on each team and their parents. Also, data need to be kept on the coaches for each team.Draw the model described below.Entities required: Team, Player, Coach and Parent.Attributes required:Team: Team ID Number, Team name, and Team colours,Player: Player ID, Player first name, Player last name, and player age,Coach: Coach ID Number, Coach first name, Coach last name, and Coach phone number,Parent: Parent ID number, Parent last name, Parent first name, Home phone number and Home address [street, city, state, postcode]The following relationship must be defined: Team is related to Player Team is related to Coach Player is related to Parent

Connectivities and participations are defined as follows: A Team may or may not have a Player. A Player must have a Team. A Team may have many Players. A Player has only one Team. A Team may or may not have a Coach. A Coach must have a Team. A Team may have many Coaches. A Coach has only one Team. A Player must have a Parent. A Parent must have a Player. A Player must have many Parents. A Parent may have many Players.

1

textTable

HOTEL

PKHotel_ID

Hotel_Name Hotel_Address Phone_Num Fax_Num

CUSTOMER

PKCustomer_ID

Customer_Name Custome_ Address Cust_Phone

textTable