0% found this document useful (0 votes)
40 views

E R Examples

The document describes an entity-relationship diagram for a car insurance company. It includes the following entities: Customer, Car, and Accident. A Customer can own many Cars. A Customer, Car, and Accident have a many-to-many-to-many relationship to model that a Customer and Car can be involved in many Accidents. The diagram does not consider a Policy entity with attributes like policy ID and limit. Each Accident is assumed to involve a single Customer and Car, so a relationship between those entities is not needed.

Uploaded by

Amitpal Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
40 views

E R Examples

The document describes an entity-relationship diagram for a car insurance company. It includes the following entities: Customer, Car, and Accident. A Customer can own many Cars. A Customer, Car, and Accident have a many-to-many-to-many relationship to model that a Customer and Car can be involved in many Accidents. The diagram does not consider a Policy entity with attributes like policy ID and limit. Each Accident is assumed to involve a single Customer and Car, so a relationship between those entities is not needed.

Uploaded by

Amitpal Singh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Car Insurance Company

• Construct an E-R diagram for a car insurance company


whose customers own one or more cars each. Each car
has associated with it zero to any number of recorded
accidents.
• Entity:
– Customer [ID, Name, Address, Phone, DOB]
– Car [License, Year, Color, Model]
– Accident [ID_number, Date, Amount]
• Relationship:
– Own (Customer, Car) [1-many]
– Participate (Customer, Car, Accident) [many-many-many]
Discussion
• Does not consider policy [PID, Limit]
• Each accident must include a customer and a
car, why not a relationship?
PID Limit

ID buy Policy

License Color
own
Customer
Year
Car
Amount

Name
Model
has_accident

Address
Date
Number
University
• A university registrar’s office maintains data about the
following entities: (a) courses, including course number,
title, credits, syllabus, and prerequisites; (b) course
offerings, including course number, year, semester, section
number, instructor(s), timings, and classroom; (c) students,
including student-id, name, and program; and (d)
instructors, including identification number, name,
department, and title. Furthermore, the enrollment of
students in courses and grades awarded to students in each
course they are enrolled for must be appropriately
modeled.
Construct an E-R diagram for the registrar’s office.
Document all assumptions that you make about the mapping
constraints.
University
• A university registrar’s office maintains data about the
following entities: (a) courses, including course number,
title, credits, syllabus, and prerequisites; (b) course
offerings, including course number, year, semester, section
number, instructor(s), timings, and classroom; (c) students,
including student-id, name, and program; and (d)
instructors, including identification number, name,
department, and title. Furthermore, the enrollment of
students in courses and grades (transcript) awarded to
students in each course they are enrolled for must be
appropriately modeled.
Construct an E-R diagram for the registrar’s office.
Document all assumptions that you make about the mapping
constraints.
TIming Year

Classroom Semester

Offering

Section
number is_offered
teach
Syllabus Name

Courses Dept
Pre- Instructor
requisite
Transcript
ID Title
Title

Name
Credit Grade

Student
Program

GOOD ENOUGH?
ID
Problem
• Prerequisites are also courses, need to be
constrained so that they are “courses”
• The key of offerings contains all attributes –
not so good

You might also like