SlideShare a Scribd company logo
Entity-Relationship Modelling
2
Objectives
3
 How to use Entity–Relationship (ER) modeling in
database design.
 Basic concepts associated with ER model.
 Diagrammatic technique for displaying ER model
using Unified Modeling Language (UML).
 How to identify and resolve problems with ER
models called connection traps.
 How to build an ER model from a requirements
ER Diagram of Branch View of DreamHome
4
Concepts of the ER Model
5
 Entity types
 Relationship types
 Attributes
Entity Type
6
 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.
Examples of Entity Types
7
ER Diagram of Staff and Branch Entity Types
8
Relationship Types
9
 Relationship type
 Set of meaningful associations among entity types.
 Relationship occurrence
 Uniquely identifiable association, which includes one
occurrence from each participating entity type.
Semantic Net of Has Relationship Type
10
ER Diagram of Branch Has Staff Relationship
11
Relationship Types
12
 Degree of a Relationship
 Number of participating entities in relationship.
 Relationship of degree:
 two is binary;
 three is ternary;
 four is quaternary.
Binary Relationship called POwns
13
Ternary Relationship called Registers
14
Quaternary Relationship called Arranges
15
Relationship Types
16
 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.
 1 to 1
 1 to many ( one student applied many car pass)
 Many to many (Student and enrolled subject)
Recursive Relationship called Supervises with Role
Names
17
Entities associated through two distinct
Relationships with Role Names
18
Video streaming system (SouthernTube)
19
Student
ID(PK)
Name
Email
phoneNo
Video
ID (PK)
Title
Description
Keyword
DateTime
StudentID
status
1..1 0..*
has
Like
ID
VideoID
StudentID
CommentID
DateTime
Comment
ID
VideoID
StudentID
Content
DateTime
Attributes
20
 Attribute
 Property of an entity or a relationship type.
 Attribute Domain
 Set of allowable values for one or more attributes.
Attributes
21
 Simple Attribute
 Attribute composed of a single component with an
independent existence.
 Composite Attribute
 Attribute composed of multiple components, each with
an independent existence.
Attributes
22
 Single-valued Attribute
 Attribute that holds a single value for each occurrence
of an entity type.
 Multi-valued Attribute
 Attribute that holds multiple values for each occurrence
of an entity type.
Attributes
23
 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.
Keys
24
 Candidate Key
 Minimal set of attributes that uniquely identifies each
occurrence of an entity type.
 Primary Key
 Candidate key selected to uniquely identify each
occurrence of an entity type.
 Composite Key
 A candidate key that consists of two or more attributes.
ER Diagram of Staff and Branch Entities and
their Attributes
25
Entity Type
26
 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.
Strong Entity Type called Client and Weak Entity
Type called Preference
27
Relationship called Advertises with Attributes
28
Structural Constraints
29
 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.
Structural Constraints
30
 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 (*:*)
Semantic Net of Staff Manages Branch
Relationship Type
31
Multiplicity of Staff Manages Branch (1:1)
Relationship Type
32
Semantic Net of Staff Oversees PropertyForRent
Relationship Type
33
Multiplicity of Staff Oversees PropertyForRent
(1:*) Relationship Type
34
Semantic Net of Newspaper Advertises
PropertyForRent Relationship Type
35
Multiplicity of Newspaper Advertises
PropertyForRent (*:*) Relationship
36
Structural Constraints
37
 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.
Semantic Net of Ternary Registers Relationship
with Values for Staff and Branch Entities Fixed
38
Multiplicity of Ternary Registers Relationship
39
Summary of Multiplicity Constraints
40
Structural Constraints
41
 Multiplicity is made up of two types of restrictions on
relationships: cardinality and participation.
 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.
Multiplicity as Cardinality and Participation
Constraints
42
Problems with ER Models
43
 Problems may arise when designing a conceptual
data model called connection traps.
 Often due to a misinterpretation of the meaning of
certain relationships.
 Two main types of connection traps are called fan
traps and chasm traps.
Problems with ER Models
44
 Fan Trap
 Where a model represents a relationship between entity
types, but pathway between certain entity occurrences is
ambiguous.
 Chasm Trap
 Where a model suggests the existence of a relationship
between entity types, but pathway does not exist between
certain entity occurrences.
An Example of a Fan Trap
45
Semantic Net of ER Model with Fan Trap
46
 At which branch office does staff number SG37
work?
Restructuring ER Model to Remove Fan Trap
47
Semantic Net of Restructured ER Model with Fan
Trap Removed
48
 SG37 works at branch B003.
An Example of a Chasm Trap
49
Semantic Net of ER Model with Chasm Trap
50
 At which branch office is property PA14 available?
ER Model Restructured to Remove Chasm Trap
51
Semantic Net of Restructured ER Model with
Chasm Trap Removed
52
Discussion
53
GrabTaxi Holdings Pte. Ltd. (branded as simply Grab) is a transportation
network company based in Singapore. In addition to transportation, the company
offers food delivery services via mobile app. It operates in the Southeast Asian
countries of Singapore. (From wikipedia)
Design the database which provides the similar service for Grab
Assignment 1
54
Shopping Cart
Create a shopping cart database ER-D based on Lazada as
case studies.

More Related Content

PDF
Dbms Model.pdf
PDF
ER Model in the Database Computer Science.pdf
PPTX
PPTX
ECEG 4702-Class7-Entity-Relationship modeling.pptx
PPTX
DBMS - ER Model
PPTX
Er model
PPTX
lecture-4-Data Base Mangement System and its types
PPTX
ch3 final.pptx
Dbms Model.pdf
ER Model in the Database Computer Science.pdf
ECEG 4702-Class7-Entity-Relationship modeling.pptx
DBMS - ER Model
Er model
lecture-4-Data Base Mangement System and its types
ch3 final.pptx

Similar to Entity-Relationaship diagram for practice (20)

PDF
Pokok bahasan #3a er modeling
PPTX
Entity-Relationship Diagram (ERD) Material.pptx
PPTX
Entity Relationship Modelling
PPTX
Database part3-
PPTX
Er diagrams presentation
PPTX
Er diagrams presentation
PPTX
database.pptx
PPTX
Lecture 1 Data Modeling Using the Entity-Relationship (ER) Model.pptx
PDF
erdiagramspresentation-150826044953-lva1-app6891.pdf
PDF
Lecture one db
PPT
E-R Model Entity relationship model, Entity, Attributes.ppt
PPT
Entity relationship Model, Unit-1.2-1.ppt
PPT
ER Diagram introduction .ppt
PPTX
er-models.pptx
PPTX
Er model ppt
PPTX
Unit 1-Data Modeling using Entity Relationship (E-R) Diagram.pptx
PPTX
ermodelppt-181229121745.pptx
PPT
ENTITY RELATION SHIPS COMPLETE ANALYSIS UPDATED
PPT
Database design
Pokok bahasan #3a er modeling
Entity-Relationship Diagram (ERD) Material.pptx
Entity Relationship Modelling
Database part3-
Er diagrams presentation
Er diagrams presentation
database.pptx
Lecture 1 Data Modeling Using the Entity-Relationship (ER) Model.pptx
erdiagramspresentation-150826044953-lva1-app6891.pdf
Lecture one db
E-R Model Entity relationship model, Entity, Attributes.ppt
Entity relationship Model, Unit-1.2-1.ppt
ER Diagram introduction .ppt
er-models.pptx
Er model ppt
Unit 1-Data Modeling using Entity Relationship (E-R) Diagram.pptx
ermodelppt-181229121745.pptx
ENTITY RELATION SHIPS COMPLETE ANALYSIS UPDATED
Database design
Ad

Recently uploaded (20)

DOCX
ch 9 botes for OB aka Pregnant women eww
PPTX
Nancy Caroline Emergency Paramedic Chapter 15
PPTX
Benign prostatic hyperplasia, uro anaesthesia
PDF
Zuri Health Pan-African Digital Health Innovator.pdf
PPTX
unit1-introduction of nursing education..
PDF
ENT MedMap you can study for the exam with this.pdf
PPTX
guidance--unit 1 semester-5 bsc nursing.
PPTX
Nancy Caroline Emergency Paramedic Chapter 1
PPTX
Nancy Caroline Emergency Paramedic Chapter 4
PDF
Culturally Sensitive Health Solutions: Engineering Localized Practices (www....
PPTX
Nancy Caroline Emergency Paramedic Chapter 17
DOCX
PT10 continues to explose your mind right after reading
PPTX
Hospital Services healthcare management in india
PDF
cerebral aneurysm.. neurosurgery , anaesthesia
PDF
Essentials of Hysteroscopy at World Laparoscopy Hospital
PPT
Pyramid Points Acid Base Power Point (10).ppt
PPTX
Full Slide Deck - SY CF Talk Adelaide 10June.pptx
PPTX
Nancy Caroline Emergency Paramedic Chapter 13
PPTX
Nancy Caroline Emergency Paramedic Chapter 7
PPTX
Nancy Caroline Emergency Paramedic Chapter 11
ch 9 botes for OB aka Pregnant women eww
Nancy Caroline Emergency Paramedic Chapter 15
Benign prostatic hyperplasia, uro anaesthesia
Zuri Health Pan-African Digital Health Innovator.pdf
unit1-introduction of nursing education..
ENT MedMap you can study for the exam with this.pdf
guidance--unit 1 semester-5 bsc nursing.
Nancy Caroline Emergency Paramedic Chapter 1
Nancy Caroline Emergency Paramedic Chapter 4
Culturally Sensitive Health Solutions: Engineering Localized Practices (www....
Nancy Caroline Emergency Paramedic Chapter 17
PT10 continues to explose your mind right after reading
Hospital Services healthcare management in india
cerebral aneurysm.. neurosurgery , anaesthesia
Essentials of Hysteroscopy at World Laparoscopy Hospital
Pyramid Points Acid Base Power Point (10).ppt
Full Slide Deck - SY CF Talk Adelaide 10June.pptx
Nancy Caroline Emergency Paramedic Chapter 13
Nancy Caroline Emergency Paramedic Chapter 7
Nancy Caroline Emergency Paramedic Chapter 11
Ad

Entity-Relationaship diagram for practice

  • 2. 2
  • 3. Objectives 3  How to use Entity–Relationship (ER) modeling in database design.  Basic concepts associated with ER model.  Diagrammatic technique for displaying ER model using Unified Modeling Language (UML).  How to identify and resolve problems with ER models called connection traps.  How to build an ER model from a requirements
  • 4. ER Diagram of Branch View of DreamHome 4
  • 5. Concepts of the ER Model 5  Entity types  Relationship types  Attributes
  • 6. Entity Type 6  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.
  • 8. ER Diagram of Staff and Branch Entity Types 8
  • 9. Relationship Types 9  Relationship type  Set of meaningful associations among entity types.  Relationship occurrence  Uniquely identifiable association, which includes one occurrence from each participating entity type.
  • 10. Semantic Net of Has Relationship Type 10
  • 11. ER Diagram of Branch Has Staff Relationship 11
  • 12. Relationship Types 12  Degree of a Relationship  Number of participating entities in relationship.  Relationship of degree:  two is binary;  three is ternary;  four is quaternary.
  • 16. Relationship Types 16  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.  1 to 1  1 to many ( one student applied many car pass)  Many to many (Student and enrolled subject)
  • 17. Recursive Relationship called Supervises with Role Names 17
  • 18. Entities associated through two distinct Relationships with Role Names 18
  • 19. Video streaming system (SouthernTube) 19 Student ID(PK) Name Email phoneNo Video ID (PK) Title Description Keyword DateTime StudentID status 1..1 0..* has Like ID VideoID StudentID CommentID DateTime Comment ID VideoID StudentID Content DateTime
  • 20. Attributes 20  Attribute  Property of an entity or a relationship type.  Attribute Domain  Set of allowable values for one or more attributes.
  • 21. Attributes 21  Simple Attribute  Attribute composed of a single component with an independent existence.  Composite Attribute  Attribute composed of multiple components, each with an independent existence.
  • 22. Attributes 22  Single-valued Attribute  Attribute that holds a single value for each occurrence of an entity type.  Multi-valued Attribute  Attribute that holds multiple values for each occurrence of an entity type.
  • 23. Attributes 23  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.
  • 24. Keys 24  Candidate Key  Minimal set of attributes that uniquely identifies each occurrence of an entity type.  Primary Key  Candidate key selected to uniquely identify each occurrence of an entity type.  Composite Key  A candidate key that consists of two or more attributes.
  • 25. ER Diagram of Staff and Branch Entities and their Attributes 25
  • 26. Entity Type 26  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.
  • 27. Strong Entity Type called Client and Weak Entity Type called Preference 27
  • 28. Relationship called Advertises with Attributes 28
  • 29. Structural Constraints 29  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.
  • 30. Structural Constraints 30  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 (*:*)
  • 31. Semantic Net of Staff Manages Branch Relationship Type 31
  • 32. Multiplicity of Staff Manages Branch (1:1) Relationship Type 32
  • 33. Semantic Net of Staff Oversees PropertyForRent Relationship Type 33
  • 34. Multiplicity of Staff Oversees PropertyForRent (1:*) Relationship Type 34
  • 35. Semantic Net of Newspaper Advertises PropertyForRent Relationship Type 35
  • 36. Multiplicity of Newspaper Advertises PropertyForRent (*:*) Relationship 36
  • 37. Structural Constraints 37  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.
  • 38. Semantic Net of Ternary Registers Relationship with Values for Staff and Branch Entities Fixed 38
  • 39. Multiplicity of Ternary Registers Relationship 39
  • 40. Summary of Multiplicity Constraints 40
  • 41. Structural Constraints 41  Multiplicity is made up of two types of restrictions on relationships: cardinality and participation.  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.
  • 42. Multiplicity as Cardinality and Participation Constraints 42
  • 43. Problems with ER Models 43  Problems may arise when designing a conceptual data model called connection traps.  Often due to a misinterpretation of the meaning of certain relationships.  Two main types of connection traps are called fan traps and chasm traps.
  • 44. Problems with ER Models 44  Fan Trap  Where a model represents a relationship between entity types, but pathway between certain entity occurrences is ambiguous.  Chasm Trap  Where a model suggests the existence of a relationship between entity types, but pathway does not exist between certain entity occurrences.
  • 45. An Example of a Fan Trap 45
  • 46. Semantic Net of ER Model with Fan Trap 46  At which branch office does staff number SG37 work?
  • 47. Restructuring ER Model to Remove Fan Trap 47
  • 48. Semantic Net of Restructured ER Model with Fan Trap Removed 48  SG37 works at branch B003.
  • 49. An Example of a Chasm Trap 49
  • 50. Semantic Net of ER Model with Chasm Trap 50  At which branch office is property PA14 available?
  • 51. ER Model Restructured to Remove Chasm Trap 51
  • 52. Semantic Net of Restructured ER Model with Chasm Trap Removed 52
  • 53. Discussion 53 GrabTaxi Holdings Pte. Ltd. (branded as simply Grab) is a transportation network company based in Singapore. In addition to transportation, the company offers food delivery services via mobile app. It operates in the Southeast Asian countries of Singapore. (From wikipedia) Design the database which provides the similar service for Grab
  • 54. Assignment 1 54 Shopping Cart Create a shopping cart database ER-D based on Lazada as case studies.

Editor's Notes

  • #1: ERD SQL Normalization
  • #2: Logical
  • #17: Like C2C e-commerce customer sell products to customers
  • #20: Gender – M or F Quantity – 0-1000
  • #24: Integrity in chapter 2 Student (ID, Name, IC , email, phone, address, gender………) candidate key are ID, IC and email Primary key select from candidate key is ID Composite key (phone+address) We defined ID, IC and email as index Search student info, but I didn’t know the studentID, I can search by email. Searching purpose
  • #40: One student have 0….2 car pass