0% found this document useful (0 votes)
7 views43 pages

ER Modeling Edited

ER Modeling by Edison UICT

Uploaded by

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

ER Modeling Edited

ER Modeling by Edison UICT

Uploaded by

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

Entity-Relationship modeling

Instructor:
Nkurunungi Edison

© Pearson Education Limited 1995, 2005


Objectives
• How to use Entity–Relationship (ER) modeling in
database design.

• Basic concepts associated with ER model.

• How to identify and resolve problems with ER models


called connection traps.

• How to build an ER model from a requirements


specification.

© Pearson Education Limited 1995, 2005 2


ER diagram of Branch user views of
DreamHome

© Pearson Education Limited 1995, 2005 3


Concepts of the ER Model
• Entity types
• Relationship types
• Attributes

© Pearson Education Limited 1995, 2005 4


Entity Type
• Entity type
– Group of objects with same properties,
identified by enterprise as having an
independent existence.

• Entity occurrence
– Uniquely identifiable object of an entity type.

© Pearson Education Limited 1995, 2005 5


Examples of Entity Types

© Pearson Education Limited 1995, 2005 6


ER diagram of Staff and Branch entity
types

© Pearson Education Limited 1995, 2005 7


Relationship Types
• Relationship type
– Set of meaningful associations among entity
types.

• Relationship occurrence
– Uniquely identifiable association, which
includes one occurrence from each
participating entity type.

© Pearson Education Limited 1995, 2005 8


Semantic net of Has relationship type

© Pearson Education Limited 1995, 2005 9


ER diagram of Branch Has Staff
relationship

© Pearson Education Limited 1995, 2005 10


Relationship Types
• Degree of a Relationship
– Number of participating entities in relationship.

• Relationship of degree :
– two is binary
– three is ternary
– four is quaternary.

© Pearson Education Limited 1995, 2005 11


Binary relationship called POwns

© Pearson Education Limited 1995, 2005 12


Ternary relationship called Registers

© Pearson Education Limited 1995, 2005 13


Quaternary relationship called Arranges

© Pearson Education Limited 1995, 2005 14


Relationship Types
• Recursive Relationship
– Relationship type where same entity type
participates more than once in different roles.

• Relationships may be given role names to


indicate purpose that each participating
entity type plays in a relationship.

© Pearson Education Limited 1995, 2005 15


Recursive relationship called Supervises
with role names

© Pearson Education Limited 1995, 2005 16


Entities associated through two distinct
relationships with role names

© Pearson Education Limited 1995, 2005 17


Attributes
• Attribute
– Property of an entity or a relationship type.

• Attribute Domain
– Set of allowable values for one or more
attributes.
– E.g. Rooms in hotel (1-300), Age (1-99), Married (yes or no),
Nationality (Nepalese, Indian, American, or British), Color (Red ,
Yellow , Green)

© Pearson Education Limited 1995, 2005 18


Attributes
• Simple Attribute
– Attribute composed of a single component with an
independent existence
– A simple attribute cannot be subdivided. For example the
attributes age, sex etc are simple attributes.
• Composite Attribute
• Attribute composed of multiple components, each with an
independent existence
• A composite attribute is an attribute that can be further
subdivided. For example the attribute ADDRESS can be
subdivided into street, city, state, and zip code.

© Pearson Education Limited 1995, 2005 19


Attributes
• Single-valued Attribute
• Attribute that holds a single value for each occurrence
of an entity type
• The majority of attributes are single-valued for a
particular entity (e.g. a person can only have a single
value for DOB, Age etc).

• Multi-valued Attribute
– Attribute that holds multiple values for each
occurrence of an entity type (e.g. a person may have
multiple phone numbers, multiple degrees etc)

© Pearson Education Limited 1995, 2005 20


Single-valued Vs Multi-valued attributes

• Single Valued Attribute: Attribute that hold a single value


Example1: Age
Exampe2: City
Example3:Customer id

• Multi Valued Attribute: Attribute that hold multiple


values.
Example1: A customer can have multiple phone
numbers, email id's etc
Example2: A person may have several college degrees

21
Attributes
• Derived Attribute
– Attribute that represents a value that is derivable
from value of a related attribute, or set of
attributes, not necessarily in the same entity type.
– The value for the derived attribute is derived from the
stored attribute. For example 'Date of birth' of a
person is a stored attribute. The value for the attribute
'AGE' can be derived by subtracting the 'Date of
Birth'(DOB) from the current date.

© Pearson Education Limited 1995, 2005 22


Stored and Derived Attributes
• Stored Attribute: An attribute that supplies a
value to the related attribute.
Example: Date of Birth
• Derived Attribute: An attribute whose value is
derived from a stored attribute.
Example : age, and it’s value is derived from
the stored attribute Date of Birth.

23
Keys
• Candidate Key
– Minimal set of attributes that uniquely identifies each
occurrence of an entity type.
– a column in a table which has the ability to become a primary
key.

• Primary Key
– Candidate key selected to uniquely identify each occurrence
of an entity type.
– The attribute or combination of attributes that uniquely
identifies a row or record.
• Composite Key
– A candidate key that consists of two or more attributes.

© Pearson Education Limited 1995, 2005 24


ER diagram of Staff and Branch entities
and their attributes

© Pearson Education Limited 1995, 2005 25


Entity Type
• Strong Entity Type
– Entity type that is not existence-dependent
on some other entity type.

• Weak Entity Type


– Entity type that is existence-dependent on
some other entity type.

© Pearson Education Limited 1995, 2005 26


Strong entity type called Client and weak
entity type called Preference

© Pearson Education Limited 1995, 2005 27


Relationship called Advertises with attributes

© Pearson Education Limited 1995, 2005 28


Structural Constraints
• Main type of constraint on relationships is
called multiplicity.
• Multiplicity - number (or range) of possible
occurrences of an entity type that may relate
to a single occurrence of an associated entity
type through a particular relationship.
• Represents policies (called business rules)
established by user or company.

© Pearson Education Limited 1995, 2005 29


Structural Constraints
• The most common degree for
relationships is binary.
• Binary relationships are generally
referred to as being:
– one-to-one (1:1)
– one-to-many (1:*)
– many-to-many (*:*)

© Pearson Education Limited 1995, 2005 30


Semantic net of Staff Manages Branch
relationship type

© Pearson Education Limited 1995, 2005 31


Multiplicity of Staff Manages Branch
(1:1) relationship

© Pearson Education Limited 1995, 2005 32


Semantic net of Staff Oversees
PropertyForRent relationship type

© Pearson Education Limited 1995, 2005 33


Multiplicity of Staff Oversees PropertyForRent
(1:*) relationship type

© Pearson Education Limited 1995, 2005 34


Semantic net of Newspaper Advertises
PropertyForRent relationship type

© Pearson Education Limited 1995, 2005 35


Multiplicity of Newspaper Advertises
PropertyForRent (*:*) relationship

© Pearson Education Limited 1995, 2005 36


Structural Constraints
• Multiplicity for Complex Relationships
– Number (or range) of possible occurrences
of an entity type in an n-ary relationship
when other (n-1) values are fixed.

© Pearson Education Limited 1995, 2005 37


Semantic net of ternary Registers relationship
with values for Staff and Branch entities fixed

© Pearson Education Limited 1995, 2005 38


Multiplicity of ternary Registers relationship

© Pearson Education Limited 1995, 2005 39


Summary of multiplicity constraints

© Pearson Education Limited 1995, 2005 40


Structural Constraints
• Multiplicity is made up of two types of
restrictions on relationships:
cardinality and participation.

© Pearson Education Limited 1995, 2005 41


Structural Constraints

• Cardinality
– Describes maximum number of possible
relationship occurrences for an entity
participating in a given relationship type.
• Participation
– Determines whether all or only some entity
occurrences participate in a relationship.

© Pearson Education Limited 1995, 2005 42


Multiplicity as cardinality and
participation constraints

© Pearson Education Limited 1995, 2005 43

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy