Database

Cardinalities on the ER diagram

Page 1 of 1

2 Replies - 763 Views - Last Post: 20 October 2008 - 03:04 PM Rate Topic: -----

#1 chetah  Icon User is offline

  • D.I.C Head

Reputation: 2
  • View blog
  • Posts: 111
  • Joined: 17-November 07

Database

Post icon  Posted 19 October 2008 - 01:19 PM

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)

need help in constructing an ER diagram showing the cardinalites

Is This A Good Question/Topic? 1
  • +

Replies To: Database

#2 Hary  Icon User is offline

  • D.I.C Regular

Reputation: 44
  • View blog
  • Posts: 427
  • Joined: 23-September 08

Re: Database

Posted 20 October 2008 - 11:20 AM

How to draw an ER for dummies:
- Draw a box per entity (a line in your listing)
- Put its name in it
- From every entity , draw a line to the entity which it has an Id for
- Put a one* on the originating end, and a Star on the other end
- Tadaah!

* Note: This is the only thing you need your two brain cells for. Think whether the destination needs to be linked to the originating entity always once, so does the destination _always_ need the originator. In your case: does a rental always need a car? Then it's a one. If you can insert a rent, but the company does not directly link it to a car, then it is a 0/1 (either zero or one)
Was This Post Helpful? 1
  • +
  • -

#3 Mach1Guy  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 5
  • View blog
  • Posts: 89
  • Joined: 04-December 06

Re: Database

Posted 20 October 2008 - 03:04 PM

if you still need help make sure to post what you have so far and we can go from there
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1