Entity Relationship diagrams
A car rental company has several car rental agencies across the country. The agencies rent several classes of vehicles:compact, midsize, full size, sport utility. Each vehicle is managed by one agency. Customers rent vehicles from the different agencies. When a vehicle is rented, a new rental record is added to the Rental table with dateout as the current date and dateReturned is left null. When a vehicle is returned the record is updated by filling in the DateReturned field. A portion of the car rental table is given below.
Vehicle(VehicleId, VehicleClassId, AgencyId)
Rental( RentalId, VehicleId, CustomerId, DateOut , DateReturned)
Customer( CustomerId, CustomerName, CustomerBalance)
Agency( AgencyId, AgencyLocation)
vehicleClass(VehicleClassId, VehicleClass, RentalRate)
help needed in creating an entity relationship diagram
2 Attachment(s)
The ERD to the Agency Vehicle Rentals
Dear Chetah,
Let's see now. We assume that
1 - One Agency can have Many Customers but One Customer has to belong to only to One Agency - Relationship No. 1 (1-to-many)
2 - One Customer can have Many Rentals but One Rental has to belong to only one Customer - Relationship No. 2 - (1-to-many)
3 - One Rental can have Many Vehicles but One Vehicle has to belong to only One Rental at One Time since you can not rent one vehicle at the same time - Relationship No. 3 - (1-to-many)
4 - One Vehicle Class can have many Vehicles but one Vehicle has to have only One Vehicle Class - Relatioship No. 4 - (1-to-many)
And so we have:
Attachment 502
I have come across the problem and can not understand why rental has to be connected to Agency while it is already connected to Agency through the Customer (As I have Done Above). If we connect Rental to Agency Than we also have to connect The Rental to Customer. So we will have two relationships as below.
Attachment 503
Which is right? Anu Body.
Regards
Jawad