Professional Documents
Culture Documents
Database System Concepts 03
Database System Concepts 03
Database System Concepts 03
2
Overview
ER Data Model Foreign Key
Relationships
Types of Entity type
Symbol for Relationships
Weak Entity Types
Relationships types
Strong Entity Type 1. Unary Relationship
Naming Entity Types 2. Binary Relationship
Symbols Attributes of the
Attribute Relationship
3. Ternary Relationships
Types of Attributes
Symbols for Attributes
3
Primary Key
ER Data Model (or E-R Model)
The ER model defines the conceptual
view of a database. It works around real-
world entities and the associations among
them.
At view and engineering level, the ER
model is considered as a good option for
designing databases.
4
ER Data Model (or E-R Model)
An entity-relationship model (e-r model) is a
detailed, logical representation of the data for an
organization or for a business area.
The E-R model is expressed in terms of entities in the
business environment, the relationships (or
associations) among those entities, and the attributes
(or properties) of both the entities and their
relationships.
An E-R model is normally expressed as an entity-
relationship diagram (E-R diagram, or ERD), which is
a graphical representation of an E-R model.
5
E-R Model vs. E-R diagram
E-R Diagram:
E-R Model:
A graphical
Logical representation representation of an
of the data for an entity-relationship
organization or for a model.
business area, using
entities for categories
of data and
relationships for
associations between
entities. 6
Major Components of ERD
Entities
Attributes
Relationships
7
Entity
Term used to mean three different
meanings
Entity type
Entity instance
Entity set
8
Entity Type
A name/label assigned to
items/objects that exist in an
environment and that have similar
properties
It could be person, place, event or
even concept
Entity Type
Distinguishable from other entity types on
the basis of properties
Identified through abstraction process
Different from External Entity (Not from un-
related terminology)
Entity Instance & Set
2. Weak/Dependent ETs
12
Weak Entity Types
13
Strong Entity Type
14
15
Naming Entity Types
16
Symbols
Reg Entity Type NAME
BOOK BOOK_COPY
17
Attribute
18
1. Simple Attributes-
19
2. Composite Attributes-
20
3. Single Valued
Attributes-
21
4. Multi Valued Attributes-
22
5. Derived Attributes-
23
6. Key Attributes-
24
Symbols for Attributes
25
Types of Attributes
26
Symbols for Attributes
Simple
Composite
Multi-valued
Derived
27
Example
EMPLOYEE address
28
Table
Customers
29
Field (Column)
Customers
a field
30
Record (Row)
Customers
a record
31
Primary Key
Customers
Directors
DEPT EMP
STD BOOK
36
Relationships types
37
One-to-One Relationships
One-to-Many Relationships
Many to One Relationships
Many-to-Many Relationships
38
39
1.One-to-one:
One instance from entity set X can be
associated with at most one instance of
entity set Y and vice versa.
Example: One student can register for
numerous courses. However, all those
courses have a single line back to that
one student. But one at a time.
40
One to one
Deptt HoD
41
2.One-to-many:
One instance from entity set X can be
associated with multiple instances of
entity set Y, but an entity from entity
set Y can be associated with at least
one entity.
For example, one class is consisting of
multiple students.
42
43
3. Many to One
More than one instances from entity set
X can be associated with at most one
instance of entity set Y. However, an
instance from entity set Y may or may
not be associated with more than one
instance from entity set X.
For example, many students belong to
the same class.
44
45
4. Many to Many:
One instance from Entity X can be
associated with more than one
Instances from Y and vice versa.
For example, Students as a group are
associated with multiple faculty
members, and faculty members can be
associated with multiple students.
46
47
Sample ERD
48