Sunday, 27 March 2011

Chapter 3: Entity Relationship Diagram (ERD/ER Model)


















Cardinality Constraint
1:M = one to many
M:1 = many to one
M:M = many to many
1:1 = one to one

Relational Key
-primary key
-foreign key
-candidate key
-composite key


Exercise :
Draw a complete ERD diagram for the following
a) a customer reserves a dute for maintenance or repair to a vehicle  the reservation is given a reservation_no,customer_id and vehicle_no are recorded with the reservation.the time_of_reservation is also recorded
b)information stored about customer includes  customer_id,customer_name,address and telephone_no
c)information kept a about the vehicle includes vehicle_no,make,reg_no and date_of_manufacture
d)after examination,a number of jobs by recorded for the vehicle.each job has a job_no with the booking,and reasons for carrying out the job are recorded as why_needed
e)the pairs used for each job and time_spent on each job are also recorded
f)the information about parts include part_no and price

Step
1. Find the entity
2. find the attribute
3. relationship sketch ERD
4. sketch ERD relationship
5. cardinality constraint
6. attribute
7. primary key/ foreign

1. Customer
-Customer_ID(PK)
-Customer_name
-Address
-Telephone_no
2.Vehicle
-Vehicle_no
-make
-Reg_no
-Date_of_manufacture
3.Reservation
-Reservation_no
-Customer_ID
-Vehicle_NO
-Time_of_reservation
4.Jobs
-Job_no
-Why_needed
5. Parts
-Parts_No
-Price
-Time_spent

No comments:

Post a Comment