Forum Moderators: phranque

Message Too Old, No Replies

Erd

Helo.. I have difficulties in translating the language into ERD...

         

vina_melody

6:26 am on Sep 25, 2004 (gmt 0)

10+ Year Member



Can someone help me to solve this problem... i confuse with my answer....

This is the question:

The company would like to store information of person and car that are insured by them. Each
person can own one or more cars. A car can only be owned by one owner, not more than one. A
person has details of driver license number, full name and address. Driver license number is
uniquely identified for each person. A car has details of license (plate number), model and year.
Each car is identified by license number.

Each car has associated with its zero to any number of recorded accidents. Accident has attributes
of report number, location and date. The damage amount must be recorded in the event of each
accident. The car owner might no be the driver of the car involved in the accident. It could be
someone else.

And my questions are:
1. What is the cardinality between car and accidents?
2. Where should I place the damage amount? is it attribute or not?
3. What is the cardinality between accident and person?

jollymcfats

7:11 am on Sep 25, 2004 (gmt 0)

10+ Year Member



I'm a little rusty with my ER notation, but I'll take a stab:

1. Optional one to many:

car 0..1 <-> * accidents

2. I'd agree that damage is an attribute of accident.
3. Can't be answered from your description alone. But:

If you're only recording the driver of the insured's vehicle at the time of the accident, it would be

accident 0..1 <-> 1 person
.

If you record both drivers, it would be

accident 0..1 <-> 2 person
, though you'd probably want to annotate that relationship to note which person was driving the insured's car.

If you record all parties involved in the accident, or all parties in the insured's car, or you want to be able to record all drivers in nasty 3+ vehicle accidents, it would be

accident 0..1 <-> 1,* person
.

vina_melody

1:15 pm on Sep 27, 2004 (gmt 0)

10+ Year Member



Thanks Jolly...

Regarding the 2nd question, what type of attribute suitable for Damage Amount?

Is it attribute of relationship (which is placed in the middle of relationship line)

OR

Attribute of Entity(Accident)

Once again, TYVM :)... the due date is getting closer...

jollymcfats

3:57 pm on Sep 27, 2004 (gmt 0)

10+ Year Member



If you want to say "there was a total of $1,000 damage in this accident," then an attribute of the accident is fine.

If you want to be able to express "this car suffered $1,000 of damage in this accident", then an attribute of the relationship would be better. You'd also be able to model the (hopefully rare) corner case when one insured customer's car smashes into another insured customer's car...

If you find yourself doing modelling more often or are enjoying it, may I suggest "Data Modelling for Information Professionals" by Bob Schmidt. It's a quick and engaging read. It's not a programming book as such- it's targetted at anyone who thinks critically about the structure of information.