Professional Documents
Culture Documents
3.2 ER Diagramming Conventions PDF
3.2 ER Diagramming Conventions PDF
Relationship Basics
Objectives
Construct ER diagram
components that represent
ER Diagramming
relationships according to
diagramming conventions
OEHB
Purpose
People speak
different languages
ER Diagramming
throughout the
world, but some
Conventions
signs are
understood globally.
OEHB
Shared Convention
It is efficient to communicate
information in a way that can
be easily understood by many
people.
ER Diagramming
OEHB
Case: HR System: EMPLOYEEs, JOBs, and DEPARTMENTs
“We need to store data about each of our company’s employees. We need to track each employee's first name, last
name, hire date and salary. For each employee on commission, we also need to track his/her potential commission.”
“Our company is divided into departments. Each employee reports to a department - for example,
accounting, sales, or development.”
Conventions
“We need to know the department responsible for each employee. Each department has a unique number.”
“All employees hold a job, and we keep track of the job title, max and min salary for each job. Every job has a
unique job id.”
OEHB
ER Drawing Conventions
Entities are
represented by
softboxes.
ER Diagramming
Entity names go
in the softboxes.
Conventions
OEHB
Drawing Conventions
Mandatory
Attributes are
attributes are
listed under the
marked with an
ER Diagramming
entity names.
asterisk: “*”
Conventions
Optional Unique
attributes are identifiers are
marked with a marked with a
circle: “o” hash sign: “#”
OEHB
Drawing Conventions
OEHB
Practice
Draw the entities.
List the attributes underneath each entity.
Specify whether they are mandatory or optional.
Identify the UIDs.
Write out the relationship in English, including optionality and cardinality.
} “In our salon, we have a number of hairstylists. } “I am an agent for several musicians and bands. A
They are all salaried employees, so we keep a record musician may be a solo performer or may belong to
of their first name, last name, address, phone a band. A band will always have one or more
ER Diagramming
number, social-security num- ber, and salary. During musicians in it. Some musi- cians are a one-man
the course of a day, a hairstylist may see several band. However, a musician can belong to only one
clients. On a slow day, a hairstylist may not work on band. Since I schedule them for concerts and events,
anyone at all. We have several walk-in clients, and I need to keep track of certain information: the
Conventions
they each get assigned to one hairstylist. We just ask musician’s first name, last name, address, phone
for their first name. We also have customers who number, and hourly rate. If it’s a band, I need to
call to make an appointment. When they do this, we know the band name in addition to the information I
ask for their first name, last name, and phone already keep for the member musicians. I’ve handled
number. We also ask if they would like a specific bands with the same name, so just to make sure I
hairstylist. If they have no preference, we assign one book the right band, I assign an ID to each one. The
for them. Of course, they are allowed to switch to hourly rate for a band is the total of the hourly
another hairstylist for their next visit to the salon. rates of its members.”
We are interested in tracking the daily appointments
-- which stylist works on which client during a given
day.”
OEHB
Practice
Draw the entities.
List the attributes underneath each entity.
Specify whether they are mandatory or optional.
Identify the UIDs.
Write out the relationship in English, including optionality and cardinality.
} “We have several teachers at our school. } “Our school offers many courses -- such as
A teacher can be assigned up to three } Data Modeling,
Introduction to SQL,
classes per semester. If a teacher is on }
ER Diagramming
} Trigo- nometry,
sabbatical, he doesn’t teach that semester. } Physics, and
We keep a record of the teacher’s first } Biology.
name, last name, address, phone number,
Conventions
OEHB