Database Design - ERD Model (Chen Crowfoot) PDF

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 23

Data Analysis and Design

Database Design : ERD Model


Chen Notation - Symbol

Rectangle represents an Entity

Diamond represents a Relationship

1 M
Lines with labels represents Cardinality

2
Entity (Chen Notation)
• is a real-world object distinguishable or unique from
other objects.
• An entity can be a concrete or physical object like
employee, student, faculty, customer etc. Or it could
also be conceptual or abstract like transaction, order,
course, subjects etc.
• It can be thought of as a noun like student, employee
etc.
• It is normally represented by a rectangle shape.

3
Database Background
• Entity could be a :
Person (ex. Teacher, Student, Physician)

Place (ex. School, Hotel, Store )

Object (ex. Mouse, Books, Bulding )

Event (ex. Enroll, Withdraw, Order )

Idea or Concept (ex. Courses, Account, Delivery )


4
Entity - Example

Customer Sales Rep

Order

Parts

5
Relationship
• is a way of relating one entity to another. Entities can
therefore participate in a relationship.
• it is commonly thought as a verb connecting the entities
or nouns.
• It is normally represented by a diamond shape.

6
Relationship - Example

Sales Rep represents Customer

has

Could be read as : A Sales Rep


Represents a Customer. And a
Customer has an Order. Order

7
Cardinality

• Cardinality: number of items that must be included


in a relationship
– An entity in a relationship with minimum cardinality
of zero plays an optional role in the relationship
– An entity with a minimum cardinality of one plays a
mandatory role in the relationship

8
Cardinality - Symbols

1 M

One-is-to-many Relationship

M N

Many-to-many Relationship

9
Cardinality Symbols - Example

1 M
Sales Rep represents Customer

Could be read as : A Sales Rep could represent


1 or Many Customers.

10
Cardinality Symbols – Example
(Cont’d)

M N
Order has Parts

Could be read as : An Order could have many Parts (e.g. Products


Ordered) and a Part could have many Orders.

11
Degree of Relationship

• There are three Degree of Relationships in ERD


notation, namely:
– Unary
– Binary
– Ternary

12
Degree of Relationship (Cont’d)
Unary

Binary

Ternary

13
Degree of Relationship (Cont’d)
Manages
Unary
Employee

makes
Customer Orders Binary

Vendor Warehouse Ternary


supplies

Part

14
Attribute
• Refers to the characteristic or basic fact or field of an
Entity or Relationship.
• For example a Student entity could have the following
attributes ID Number, Last Name, First Name,
Address, Birth Date etc.
• A relationship could also have an attribute for example
an Entity name Student enrolls (relationship) to a
Course/Program. Now, when you enroll you enroll on
a certain date so you will have an attribute of
Enrollment Date under Enroll relationship.
• It is normally represented by an oval.

15
Attribute - Example
Firstname Lastname
RepNum

Street

City
Sales Rep

State
Take note that
a Primary Key
Rate is underlined.
Zip Commission

16
Attribute – More Example
CustomerName
CustomerNum
Firstname Lastname
RepNum
Street
Street

1 M
City City
Sales Rep represents Customer

State
State

Rate CreditLimit Zip


Zip Commission
Balance

17
Crow’s Foot notation - Symbol

Entity name

Attribute 1
Attribute 2
Attribute 3
Attribute 4

18
Crow’s Foot notation - Example

Entity

Student

StudentID
Firstname
Lastname Attributes
Gender
Program

19
Crow’s Foot notation - Keys

Student

StudentID (PK) PK – Primary Key


Firstname
Lastname
Gender
ProgramID (FK) FK – Foreign Key

20
Crow’s Foot Cardinality - Symbols

One and only one included in the relationship

Zero or many could be included in the relationship.


This is optional mode.

One or many could be included in the relationship.


This is mandatory mode.

21
Crow’s Foot notation – with Cardinality
Customer
Rep Customernum(PK)
Customername
Repnum (PK)
Street
Firstname
City
Lastname
State
Commission
Zip
Rate
Balance
CreditLimit
Repnum (FK)

22
End

23

You might also like