SlideShare a Scribd company logo
ERD :: 19 / 1 / 07 1
Entity Relationship ModelingEntity Relationship Modeling
Objectives:
• To illustrate how relationships between entities are defined and refined.
• To know how relationships are incorporated into the database design
process.
• To describe how ERD components affect database design and
implementation.
ERD :: 19 / 1 / 07 2
1.0 What is Conceptual Database Design?
• Process of describing the data, relationships
between the data, relationships between the data,
and the constraints on the data.
• After analysis - Gather all the essential data
required and understand how the data are related
• The focus is on the data, rather than on the
processes.
• The output of the conceptual database design is a
Conceptual Data Model ( + Data Dictionary)
ERD :: 19 / 1 / 07 3
2.0 Gathering Information for Conceptual Data
Modeling
• Two perspectives
– Top-down
• Data model is derived from an intimate
understanding of the business.
– Bottom-up
• Data model is derived by reviewing specifications
and business documents.
ERD :: 19 / 1 / 07 4
2.0 Entity-Relationship (ER) Modeling.
• ER Modeling is a top-down approach to database
design.
• Entity Relationship (ER) Diagram
– A detailed, logical representation of the entities,
associations and data elements for an organization or
business
• Notation uses three main constructs
– Data entities
– Relationships
– Attributes
Chen Model &
Crow’s Foot
Model
Person, place, object, event
or concept about which data
is to be maintained
named property or
characteristic of an
entity
Association
between the
instances of one or
more entity types
Represents a set or collection of
objects in the real world that
share the same properties
Chen Notation
EntityName Verb Phrase AttributeName
Crow’s Foot Notation
EntityName
EntityEntity AttributeAttribute
EntityName
List of
Attributes
RelationshipRelationship
Verb phrase
Acceptable
ERD :: 19 / 1 / 07 7
2.1 Entities
• Examples of entities:
– Person: EMPLOYEE, STUDENT, PATIENT
– Place: STORE, WAREHOUSE
– Object: MACHINE, PRODUCT, CAR
– Event: SALE,REGISTRATION, RENEWAL
– Concept: ACCOUNT, COURSE
• Guidelines for naming and defining entity types:
– An entity type name is a singular noun
– An entity type should be descriptive and specific
– An entity name should be concise
– Event entity types should be named for the result of the event, not
the activity or process of the event.
ERD :: 19 / 1 / 07 8
2.2 Attributes
• Example of entity types and associated attributes:
STUDENT: Student_ID, Student_Name, Home_Address,
Phone_Number, Major
• Guidelines for naming attributes:
– An attribute name is a noun.
– An attribute name should be unique
– To make an attribute name unique and clear, each attribute name
should follow a standard format
– Similar attributes of different entity types should use similar but
distinguishing names.
ERD :: 19 / 1 / 07 9
2.2.1 Identifier Attributes
• Candidate key
– Attribute (or combination of attributes) that uniquely
identifies each instance of an entity type
– Some entities may have more than one candidate key
• Ex: A candidate key for EMPLOYEE is Employee_ID, a second is
the combination of Employee_Name and Address.
• If there is more than one candidate key, need to make a choice.
• Identifier
– A candidate key that has been selected as the unique
identifying characteristic for an entity type
ERD :: 19 / 1 / 07 10
2.2.2 Referential Attributes
Name IdNum DeptID Email
Ali 105 LG ali@a.com
Mary 106 IT mary@a.com
John 107 ENG john@a.com
Lim 108 IT lim@a.com
Name IdNum DeptID Email
Ali 105 LG ali@a.com
Mary 106 IT mary@a.com
John 107 ENG john@a.com
Lim 108 IT lim@a.com
Instance of Lecturer.
Referential attribute: Ties the lecturer entity to
another entity that is department.
• Make Reference to another instance in another table
ERD :: 19 / 1 / 07 11
Example
Staff
StaffID
Name Gender
IC
Staff
StaffID
Name
Gender
IC
PK
ERD :: 19 / 1 / 07 12
2.3 Relationships
 Associations between instances of one or more entity types that is of interest
 Given a name that describes its function.
• relationship name is an active or a passive verb.
 Associations between instances of one or more entity types that is of interest
 Given a name that describes its function.
• relationship name is an active or a passive verb.
Author Book
Relationship name:
writes
An author writes one or more books
A book can be written by one or more authors.
ERD :: 19 / 1 / 07 13
2.3.1 Degree of Relationships
• Degree: number of entity types that participate in a relationship
• Three cases
– Unary: between two instances of one entity type
– Binary: between the instances of two entity types
– Ternary: among the instances of three entity types
ERD :: 19 / 1 / 07 14
2.4 Cardinality and Connectivity
• Relationships can be classified as either
• one – to – one
• one – to – many
• many – to –many
• Cardinality : minimum and maximum number of
instances of Entity B that can (or must be)
associated with each instance of entity A.
Connectivity
ERD :: 19 / 1 / 07 15
2.4 Cardinality and Connectivity
Professor Class
teaches
A professor teaches class OR
A class is taught by professor
How Many??How Many??
Professor Classteaches
ERD :: 19 / 1 / 07 16
2.4 Cardinality and Connectivity
Professor Class
teaches
Professor Classteaches
1 M
Connectivity
Connectivity
(1,1)
(1,1)
(1,4)
(1,4)
Cardinality
Cardinality
ERD :: 19 / 1 / 07 17
2.4.1 Connectivity
• Chen Model
– 1 to represent one.
– M to represent many
• Crow’s Foot
many
One
One or many
1
M
Mandatory one , means (1,1)
Optional? – we’ll see after this
ERD :: 19 / 1 / 07 18
2.5 Binary Relationships
• 1:M relationship
– Relational modeling ideal
– Should be the norm in any relational database design
The 1: M relationship between PAINTER and PAINTING
The Implemented 1:M relationship between PAINTER and PAINTING
ERD :: 19 / 1 / 07 20
2.5 Binary Relationships
• 1:1 relationship
– Should be rare in any relational database design
– A single entity instance in one entity class is related to a single entity
instance in another entity class
– Could indicate that two entities actually belong in the same table
The 1:1 Relationship Between PROFESSOR and DEPARTMENT
The Implemented
1:1 Relationship
Between
PROFESSOR
and
DEPARTMENT
ERD :: 19 / 1 / 07 23
2.5 Binary Relationships
• M:N relationships
– Must be avoided because they lead to data redundancies.
– Can be implemented by breaking it up to produce a set of 1:M
relationships
– Can avoid problems inherent to M:N relationship by creating a
composite entity or bridge entity
• This will be used to link the tables that were originally related
in a M:N relationship
• The composite entity structure includes-as foreign keys-at
least the primary keys of the tables that are to be linked.
The M:N Relationship Between STUDENT and CLASS
This CANNOT be implemented as shown next…..
Bowser
Smithson
Accounting 1 (ACCT-211)
Intro to Microcomputing (CIS-220)
Intro to Statistics (QM-261)
The tables have many redundancies!!
+ CLASS_CODE
CLASS_CODE
+ STU_NUM
Changing the M:N relationship to TWO 1:M relationships
Converting the M:N relationship into TWO 1:M relationships
Foreign keys reference the primary keys in the
other tables of which it has a relationship with
The database designer has 2 main options to
define a composite table’s primary key:
either
use the combination of those foreign
keys or create a new primary key.
ERD :: 19 / 1 / 07 28
2.6 Mandatory vs. Optional Cardinalities
• Specifies whether an instance must exist or can be absent in the
relationship
Lecturer Class
handles
A Lecturer may handle zero or many classes.
A class is handled by one and only one Lecturer.
OptionalOptionalMandatoryMandatory
(0,N)(1,1)
Lecturer Class
(0,N) (1,1)
handles
1 M
ERD :: 19 / 1 / 07 29
2.7 How to Evaluate a Data Model?
• A good data model has the following:
– Accuracy and completeness
– Non redundancy
– Enforcement of business rules
– Data Reusability
– Stability and Flexibility
– Communication Effectiveness
– Simplicity
ERD :: 19 / 1 / 07 30
A Common Mistake
Modeling the business processes or functions
instead of the data.
What data we want to keep??
We are interested in modeling the data,
NOT the processes or functions that use
or generate those data.
ERD :: 19 / 1 / 07 31
Example:
Member BooksSearches
M N
Is this part of the data requirement?
Are we interested to know the books searched by the members?
If answer is NO, then DO NOT include that as a relationship.
Use other appropriate diagramming techniques to capture the business
processes such as Data Flow Diagram.
Do not mix up the use of ER Modeling with DFD.
ERD :: 19 / 1 / 07 32
~The END~
Q & A

More Related Content

PPTX
Load balancing in cloud computing.pptx
PPTX
Deployment
PDF
Week 1 lecture material cc
PPTX
Transmission Control Protocol (TCP)
PPTX
Active and Passive Network Attacks
PPT
Human Computer Interaction
PPTX
Apriori algorithm
PDF
Cs8591 Computer Networks
Load balancing in cloud computing.pptx
Deployment
Week 1 lecture material cc
Transmission Control Protocol (TCP)
Active and Passive Network Attacks
Human Computer Interaction
Apriori algorithm
Cs8591 Computer Networks

What's hot (20)

PPT
Osi model 7 Layers
PPT
Object Oriented Design in Software Engineering SE12
PPTX
Computer Network Architecture.pptx
PPTX
Instruction level parallelism
PPTX
SNMP/SMTP/MIME
PPTX
Remote Method Invocation
PPT
Network layer
PPT
Computer network basic concepts
PDF
CS8080 INFORMATION RETRIEVAL TECHNIQUES - IRT - UNIT - I PPT IN PDF
PPTX
Case based reasoning
PDF
PDF
Link-Based Ranking
PDF
Introduction to Software Defined Networking (SDN)
PPTX
High speed lan
PPTX
Pseudo Random Number
PPT
Real-Time Scheduling
PPTX
Introduction to Internet
PPTX
Client server architecture
PPT
Real time system tsp
PPTX
Principles of Service Orientation
Osi model 7 Layers
Object Oriented Design in Software Engineering SE12
Computer Network Architecture.pptx
Instruction level parallelism
SNMP/SMTP/MIME
Remote Method Invocation
Network layer
Computer network basic concepts
CS8080 INFORMATION RETRIEVAL TECHNIQUES - IRT - UNIT - I PPT IN PDF
Case based reasoning
Link-Based Ranking
Introduction to Software Defined Networking (SDN)
High speed lan
Pseudo Random Number
Real-Time Scheduling
Introduction to Internet
Client server architecture
Real time system tsp
Principles of Service Orientation
Ad

Viewers also liked (14)

PPTX
Entity Relationship Diagram
PPT
Entity relationship diagram (erd)
PPTX
Presentation database about ERD
PPTX
The entity relationship model
PPT
Entity Relationship Diagrams
PPTX
Entity Relationship Diagram
PDF
Entity-Relationship Diagrams ERD
PDF
How to read a data model
PPTX
Entity Relationship Diagram presentation
PPTX
Erd practice exercises
PPTX
Database - Entity Relationship Diagram (ERD)
PPT
Entity Relationship Diagram
PPTX
System development life cycle (sdlc)
Entity Relationship Diagram
Entity relationship diagram (erd)
Presentation database about ERD
The entity relationship model
Entity Relationship Diagrams
Entity Relationship Diagram
Entity-Relationship Diagrams ERD
How to read a data model
Entity Relationship Diagram presentation
Erd practice exercises
Database - Entity Relationship Diagram (ERD)
Entity Relationship Diagram
System development life cycle (sdlc)
Ad

Similar to Erd1 (20)

PPT
PPT
PPTX
Entity relationship modelling - DE L300
PPT
entity-relationship-diagram-chen-&-crow -model.ppt
PPTX
DB-Lec1.pptxUpdatedpython.pptxUpdatedpython.pptx
PPT
ERD_01B=DBMS DATA BASE MANAGEMENT SYSTEM.ppt
PPT
Erd chapter 3
PPT
Database Management System
PDF
Lecture 2 database management system.pdf
PPTX
3 Entity Relationship (E-R) Modeling_chapter 3 (1).pptx
PPTX
Database week 5 lecture includes spexiafix
PPTX
Database management systems 3 - Data Modelling
PPT
ERD(2).ppt
PPTX
Entity Relationship Model
PPTX
A database is a means of storing information in such a way that information c...
PPTX
ER Modeling and Introduction to RDBMS
PPT
Database design
PPTX
er-models.pptx
PPT
ermodelN in database management system.ppt
PPTX
IT6701 Information Management Unit-I
Entity relationship modelling - DE L300
entity-relationship-diagram-chen-&-crow -model.ppt
DB-Lec1.pptxUpdatedpython.pptxUpdatedpython.pptx
ERD_01B=DBMS DATA BASE MANAGEMENT SYSTEM.ppt
Erd chapter 3
Database Management System
Lecture 2 database management system.pdf
3 Entity Relationship (E-R) Modeling_chapter 3 (1).pptx
Database week 5 lecture includes spexiafix
Database management systems 3 - Data Modelling
ERD(2).ppt
Entity Relationship Model
A database is a means of storing information in such a way that information c...
ER Modeling and Introduction to RDBMS
Database design
er-models.pptx
ermodelN in database management system.ppt
IT6701 Information Management Unit-I

Recently uploaded (20)

PDF
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
PPTX
Geodesy 1.pptx...............................................
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PDF
Well-logging-methods_new................
PPTX
bas. eng. economics group 4 presentation 1.pptx
PDF
composite construction of structures.pdf
PPTX
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PDF
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
PPTX
Internet of Things (IOT) - A guide to understanding
PPTX
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
Welding lecture in detail for understanding
PDF
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
PDF
Digital Logic Computer Design lecture notes
PDF
Structs to JSON How Go Powers REST APIs.pdf
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
PPTX
UNIT-1 - COAL BASED THERMAL POWER PLANTS
keyrequirementskkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkkk
Geodesy 1.pptx...............................................
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
Well-logging-methods_new................
bas. eng. economics group 4 presentation 1.pptx
composite construction of structures.pdf
KTU 2019 -S7-MCN 401 MODULE 2-VINAY.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
SM_6th-Sem__Cse_Internet-of-Things.pdf IOT
Internet of Things (IOT) - A guide to understanding
Recipes for Real Time Voice AI WebRTC, SLMs and Open Source Software.pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Welding lecture in detail for understanding
Evaluating the Democratization of the Turkish Armed Forces from a Normative P...
Digital Logic Computer Design lecture notes
Structs to JSON How Go Powers REST APIs.pdf
Operating System & Kernel Study Guide-1 - converted.pdf
CYBER-CRIMES AND SECURITY A guide to understanding
Mitigating Risks through Effective Management for Enhancing Organizational Pe...
UNIT-1 - COAL BASED THERMAL POWER PLANTS

Erd1

  • 1. ERD :: 19 / 1 / 07 1 Entity Relationship ModelingEntity Relationship Modeling Objectives: • To illustrate how relationships between entities are defined and refined. • To know how relationships are incorporated into the database design process. • To describe how ERD components affect database design and implementation.
  • 2. ERD :: 19 / 1 / 07 2 1.0 What is Conceptual Database Design? • Process of describing the data, relationships between the data, relationships between the data, and the constraints on the data. • After analysis - Gather all the essential data required and understand how the data are related • The focus is on the data, rather than on the processes. • The output of the conceptual database design is a Conceptual Data Model ( + Data Dictionary)
  • 3. ERD :: 19 / 1 / 07 3 2.0 Gathering Information for Conceptual Data Modeling • Two perspectives – Top-down • Data model is derived from an intimate understanding of the business. – Bottom-up • Data model is derived by reviewing specifications and business documents.
  • 4. ERD :: 19 / 1 / 07 4 2.0 Entity-Relationship (ER) Modeling. • ER Modeling is a top-down approach to database design. • Entity Relationship (ER) Diagram – A detailed, logical representation of the entities, associations and data elements for an organization or business • Notation uses three main constructs – Data entities – Relationships – Attributes Chen Model & Crow’s Foot Model
  • 5. Person, place, object, event or concept about which data is to be maintained named property or characteristic of an entity Association between the instances of one or more entity types Represents a set or collection of objects in the real world that share the same properties Chen Notation EntityName Verb Phrase AttributeName
  • 6. Crow’s Foot Notation EntityName EntityEntity AttributeAttribute EntityName List of Attributes RelationshipRelationship Verb phrase Acceptable
  • 7. ERD :: 19 / 1 / 07 7 2.1 Entities • Examples of entities: – Person: EMPLOYEE, STUDENT, PATIENT – Place: STORE, WAREHOUSE – Object: MACHINE, PRODUCT, CAR – Event: SALE,REGISTRATION, RENEWAL – Concept: ACCOUNT, COURSE • Guidelines for naming and defining entity types: – An entity type name is a singular noun – An entity type should be descriptive and specific – An entity name should be concise – Event entity types should be named for the result of the event, not the activity or process of the event.
  • 8. ERD :: 19 / 1 / 07 8 2.2 Attributes • Example of entity types and associated attributes: STUDENT: Student_ID, Student_Name, Home_Address, Phone_Number, Major • Guidelines for naming attributes: – An attribute name is a noun. – An attribute name should be unique – To make an attribute name unique and clear, each attribute name should follow a standard format – Similar attributes of different entity types should use similar but distinguishing names.
  • 9. ERD :: 19 / 1 / 07 9 2.2.1 Identifier Attributes • Candidate key – Attribute (or combination of attributes) that uniquely identifies each instance of an entity type – Some entities may have more than one candidate key • Ex: A candidate key for EMPLOYEE is Employee_ID, a second is the combination of Employee_Name and Address. • If there is more than one candidate key, need to make a choice. • Identifier – A candidate key that has been selected as the unique identifying characteristic for an entity type
  • 10. ERD :: 19 / 1 / 07 10 2.2.2 Referential Attributes Name IdNum DeptID Email Ali 105 LG ali@a.com Mary 106 IT mary@a.com John 107 ENG john@a.com Lim 108 IT lim@a.com Name IdNum DeptID Email Ali 105 LG ali@a.com Mary 106 IT mary@a.com John 107 ENG john@a.com Lim 108 IT lim@a.com Instance of Lecturer. Referential attribute: Ties the lecturer entity to another entity that is department. • Make Reference to another instance in another table
  • 11. ERD :: 19 / 1 / 07 11 Example Staff StaffID Name Gender IC Staff StaffID Name Gender IC PK
  • 12. ERD :: 19 / 1 / 07 12 2.3 Relationships  Associations between instances of one or more entity types that is of interest  Given a name that describes its function. • relationship name is an active or a passive verb.  Associations between instances of one or more entity types that is of interest  Given a name that describes its function. • relationship name is an active or a passive verb. Author Book Relationship name: writes An author writes one or more books A book can be written by one or more authors.
  • 13. ERD :: 19 / 1 / 07 13 2.3.1 Degree of Relationships • Degree: number of entity types that participate in a relationship • Three cases – Unary: between two instances of one entity type – Binary: between the instances of two entity types – Ternary: among the instances of three entity types
  • 14. ERD :: 19 / 1 / 07 14 2.4 Cardinality and Connectivity • Relationships can be classified as either • one – to – one • one – to – many • many – to –many • Cardinality : minimum and maximum number of instances of Entity B that can (or must be) associated with each instance of entity A. Connectivity
  • 15. ERD :: 19 / 1 / 07 15 2.4 Cardinality and Connectivity Professor Class teaches A professor teaches class OR A class is taught by professor How Many??How Many?? Professor Classteaches
  • 16. ERD :: 19 / 1 / 07 16 2.4 Cardinality and Connectivity Professor Class teaches Professor Classteaches 1 M Connectivity Connectivity (1,1) (1,1) (1,4) (1,4) Cardinality Cardinality
  • 17. ERD :: 19 / 1 / 07 17 2.4.1 Connectivity • Chen Model – 1 to represent one. – M to represent many • Crow’s Foot many One One or many 1 M Mandatory one , means (1,1) Optional? – we’ll see after this
  • 18. ERD :: 19 / 1 / 07 18 2.5 Binary Relationships • 1:M relationship – Relational modeling ideal – Should be the norm in any relational database design The 1: M relationship between PAINTER and PAINTING
  • 19. The Implemented 1:M relationship between PAINTER and PAINTING
  • 20. ERD :: 19 / 1 / 07 20 2.5 Binary Relationships • 1:1 relationship – Should be rare in any relational database design – A single entity instance in one entity class is related to a single entity instance in another entity class – Could indicate that two entities actually belong in the same table
  • 21. The 1:1 Relationship Between PROFESSOR and DEPARTMENT
  • 23. ERD :: 19 / 1 / 07 23 2.5 Binary Relationships • M:N relationships – Must be avoided because they lead to data redundancies. – Can be implemented by breaking it up to produce a set of 1:M relationships – Can avoid problems inherent to M:N relationship by creating a composite entity or bridge entity • This will be used to link the tables that were originally related in a M:N relationship • The composite entity structure includes-as foreign keys-at least the primary keys of the tables that are to be linked.
  • 24. The M:N Relationship Between STUDENT and CLASS This CANNOT be implemented as shown next….. Bowser Smithson Accounting 1 (ACCT-211) Intro to Microcomputing (CIS-220) Intro to Statistics (QM-261)
  • 25. The tables have many redundancies!! + CLASS_CODE CLASS_CODE + STU_NUM
  • 26. Changing the M:N relationship to TWO 1:M relationships
  • 27. Converting the M:N relationship into TWO 1:M relationships Foreign keys reference the primary keys in the other tables of which it has a relationship with The database designer has 2 main options to define a composite table’s primary key: either use the combination of those foreign keys or create a new primary key.
  • 28. ERD :: 19 / 1 / 07 28 2.6 Mandatory vs. Optional Cardinalities • Specifies whether an instance must exist or can be absent in the relationship Lecturer Class handles A Lecturer may handle zero or many classes. A class is handled by one and only one Lecturer. OptionalOptionalMandatoryMandatory (0,N)(1,1) Lecturer Class (0,N) (1,1) handles 1 M
  • 29. ERD :: 19 / 1 / 07 29 2.7 How to Evaluate a Data Model? • A good data model has the following: – Accuracy and completeness – Non redundancy – Enforcement of business rules – Data Reusability – Stability and Flexibility – Communication Effectiveness – Simplicity
  • 30. ERD :: 19 / 1 / 07 30 A Common Mistake Modeling the business processes or functions instead of the data. What data we want to keep?? We are interested in modeling the data, NOT the processes or functions that use or generate those data.
  • 31. ERD :: 19 / 1 / 07 31 Example: Member BooksSearches M N Is this part of the data requirement? Are we interested to know the books searched by the members? If answer is NO, then DO NOT include that as a relationship. Use other appropriate diagramming techniques to capture the business processes such as Data Flow Diagram. Do not mix up the use of ER Modeling with DFD.
  • 32. ERD :: 19 / 1 / 07 32 ~The END~ Q & A