EXERCISE 2
Entity Relationship Diagram
Harris’s Pet Store has requested you to design a database to store information on sales
on animals and merchandises. The sales form is shown in Figure C1 below. Answer
questions 1 and 2.
a) Identify all entities and attributes for each entity from the Sales Form in
Figure C1. Provide your answer in the following format.
b) Using your answers in Question 1 above, draw a complete conceptual Entity
Relationship Model (ERM) to model the data in the Sales Form. Multiplicities
and primary keys must be shown on your model.
Answer :
a)
Entity Attribute
Customer CustID, CustName, Address, City, State, ZIPCode
Employee EmpID, EmpName
Animal AniID, AniName, AniCategory, Breed, DOB, Gender,
Registration, Color, AniLPrice
Merchandise Item, Description, MerCategory, MerLPrice,
Sale SaleNo, SaleDate, AniSubTotal, MerSubTotal, SaleTax,
SaleTotal
b)
Animal
+AniID(PK)
+AniName
+AniCategory
+Breed
+DOB
+Gender
+Registration
+Color
+AniLPrice
0..*
SOLD -------------------------
+SalePrice
0..*
Customer Sale
+CustID(PK) +SaleNo(PK) HANDLE Employee
MAKE
+SaleDate +EmpID(PK)
+CustName
+AniSubTotal
+Address 1..1 1..* 1..* 1..1 +EmpName
+MerSubTotal
+City +SaleTax
+State +SaleTotal
+ZIPCode
0..*
+QtySold
+MerSaPrice
SELL --------------------- +MerToItSaPrice
0..*
Merchandise
+Item(PK)
+Description
+MerCategory
+MerLPrice