You are on page 1of 20

Entity Modeling

Last week has been discussed Context diagram


and functional diagram

amsal djunid - andalas university 1


Entity Modeling

Using Entity Modeling to create the


Effective and Efficient database

amsal djunid - andalas university 2


Outline

Terminology
Type of relationship
Obligatory Relationship
E-R Model
Symbols in E-R Model
Example of E-R Model

amsal djunid - andalas university 3


Terminology

Entity Determinant
Attribute Identifier
Table Code
Relationship Foreign Identifier
Occurrence Relationship Entity

amsal djunid - andalas university 4


Entity

Any objects and concepts


Have mean to the organization
Or relevance to the system being design
Needed to store in the database
Example : student; lectures; subjects;
inventory, customer; invoice

amsal djunid - andalas university 5


Attribute

Any characteristics, elements to define or to


describe entity
Example : entity = Student
attributes: student number
name
birth date

amsal djunid - andalas university 6


Table

Means to show an entity and its attributes


Customer
Custom Address
Number
Name

Inventory
Invento Descri Quantity
Units On Hand Unit
ry No ption
Price

amsal djunid - andalas university 7


Relationship

The association of two or more of entities


Needed to store in the database
Example : invoice FOR customer

amsal djunid - andalas university 8


Occurrence

Every rows of table


Customer
Customer Customer Customer
Number Name Address
C0001 Ali Padang occurrence

C0002 Budi Bukittinggi

amsal djunid - andalas university 9


Determinant and Identifier

Determinant any attribute of the the entity that


determine the value of other attribute; such as
name determine the address of customer
Identifier is one or the combination of the
attribute that identify of the occurrence of the
entity; so it should be unique; such as customer
number

amsal djunid - andalas university 10


Foreign Key and Relationship Entity

Foreign Key is any attributes of the entity come


from other entity, means to represent the
relationship of those entities
Relationship Entity is the new entity used to
represent the relationship two or more entities

amsal djunid - andalas university 11


Invoice Customer
Invoice Custom Number
Date Custom
Number
Name Address
No.

Relationship
entity Foreign Key
Invoice details Inventory
Invento Descri Quantity
Invoice Inventory Quantity Units On Hand Unit
No ry No ption
No. Price

amsal djunid - andalas university 12


Types of Relationships

The three most important relationship type


One to One Relationship
One to Many Relationship
Many to Many Relationship

amsal djunid - andalas university 13


One to One Relationship

If one occurrence has relationship with nor more


than one occurrence in other entity
Lecturers Subjects
Ali English
Susi Math
Dewi Accounting

Lecture 1 Teaches 1 Subject

amsal djunid - andalas university 14


One to Many Relationship

Lecturers Subjects
Akmal Statistics
Ahmad Management

Ali English
Math
Dewi Accounting

Lecture 1 M Subject
Teaches

amsal djunid - andalas university 15


Many to Many Relationship

Lecturers Subjects
Akmal Statistics
Ahmad Management

Ali English
Susi Math
Dewi Accounting

Lecture M N Subject
Teaches

amsal djunid - andalas university 16


Obligatory Relationship
also known as Mandatory Relationship

Determined from each side of entity involve in


the relationship
If every occurrences have the relationship with
at least one occurrence of the other side

Lecturer Head of O Department

amsal djunid - andalas university 17


Entity Relationship Model

• Shows or represents all entities and


relationships relevance to the database
being designed
• Documenting all data to store in database
• As the basis to design phyisics database

amsal djunid - andalas university 18


Symbols for E-R Model

= entity

= relationship

= connective line
1 , M , N = relationship type
O = Obligatory relationship

amsal djunid - andalas university 19


An Example of E-R Model

Customer 1 Have 1
O O Customer Accts
1

For

M
O
Invoice M Contain M Inventory

E-R Model : Sales and Inventory Control System


amsal djunid - andalas university 20

You might also like