SlideShare a Scribd company logo
1 of 32
Entity 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.

1
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)
2
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.

3
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

4
Chen Notation

Association
between the
instances of one or
more entity types
EntityName

Person, place, object, event
or concept about which data
is to be maintained
Represents a set or collection of
objects in the real world that
share the same properties

Verb Phrase

AttributeName

named property or
characteristic of an
entity
Crow’s Foot Notation

Entity

Attribute

EntityName
EntityName
List of
Attributes

Acceptable

Relationship

Verb phrase
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.

7
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.

8
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

9
2.2.2 Referential Attributes
•

Make Reference to another instance in another table
Referential attribute: Ties the lecturer entity to
another entity that is department.

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.

10
Example

Name

Gender

IC

StaffID

Staff

Staff
PK StaffID

Name
Gender
IC

11
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.

Relationship name:
writes
Author

Book

An author writes one or more books
A book can be written by one or more authors.

12
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

13
2.4 Cardinality and Connectivity
• Relationships can be classified as either
• one – to – one
• one – to – many
• many – to –many

Connectivity

• Cardinality : minimum and maximum number of
instances of Entity B that can (or must be)
associated with each instance of entity A.

14
2.4 Cardinality and Connectivity

Professor

Professor

teaches

teaches

Class

Class

A professor teaches class OR
A class is taught by professor

How Many??

15
2.4 Cardinality and Connectivity
Connectivity

1
Professor

M
teaches

(1,4)

Class

(1,1)
Cardinality

Connectivity
teaches

Professor

(1,1)

Class

(1,4)
Cardinality
16
2.4.1 Connectivity

• Chen Model
– 1 to represent one.
– M to represent many

1

M

• Crow’s Foot
One

Mandatory one , means (1,1)

many

One or many
Optional? – we’ll see after this

17
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
18
The Implemented 1:M relationship between PAINTER and PAINTING
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

20
The 1:1 Relationship Between PROFESSOR and DEPARTMENT
The Implemented
1:1 Relationship
Between
PROFESSOR
and
DEPARTMENT
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.
23
The M:N Relationship Between STUDENT and CLASS

Bowser

Smithson

Accounting 1 (ACCT-211)
Intro to Microcomputing (CIS-220)
Intro to Statistics (QM-261)

This CANNOT be implemented as shown next…..
The tables have many redundancies!!

+ CLASS_CODE
CLASS_CODE

+ STU_NUM
Changing the M:N relationship to TWO 1:M relationships
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.

Foreign keys reference the primary keys in the
other tables of which it has a relationship with

Converting the M:N relationship into TWO 1:M relationships
2.6 Mandatory vs. Optional Cardinalities
• Specifies whether an instance must exist or can be absent in the
relationship
Mandatory

Optional

handles

Lecturer
(1,1)

(0,N)
M

1

Lecturer

Class

handles
(0,N)

Class
(1,1)

A Lecturer may handle zero or many classes.

A class is handled by one and only one Lecturer.

28
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

29
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.

30
Example:

M
Member

N
Searches

Books

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.
31
~The END~
Q&A

32

More Related Content

What's hot

College Management System Project
College Management System ProjectCollege Management System Project
College Management System ProjectManish Kushwaha
 
Oracle Forms Introduction
Oracle Forms IntroductionOracle Forms Introduction
Oracle Forms IntroductionSekhar Byna
 
Use Case diagram-UML diagram-1
Use Case diagram-UML diagram-1Use Case diagram-UML diagram-1
Use Case diagram-UML diagram-1Ramakant Soni
 
Abc cycle in sw architecture ashish
Abc cycle  in sw architecture ashishAbc cycle  in sw architecture ashish
Abc cycle in sw architecture ashishAshish Agrawal
 
UML Diagrams for Real estate management system
UML Diagrams for Real estate management systemUML Diagrams for Real estate management system
UML Diagrams for Real estate management systemStarlee Lathong
 
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Usman Tariq
 
Big Data with MySQL
Big Data with MySQLBig Data with MySQL
Big Data with MySQLIvan Zoratti
 
entity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptentity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptIRWANBINISMAILKPMGur1
 
Online property management system design document
Online property management system design documentOnline property management system design document
Online property management system design documentAbhilasha Lahigude
 
Reconstructing Software Architecture
Reconstructing Software ArchitectureReconstructing Software Architecture
Reconstructing Software ArchitectureHimanshu
 
Student result management system
Student result management systemStudent result management system
Student result management systemKazi Emad
 
NOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLRamakant Soni
 
CS8494 SOFTWARE ENGINEERING Unit-3
CS8494 SOFTWARE ENGINEERING Unit-3CS8494 SOFTWARE ENGINEERING Unit-3
CS8494 SOFTWARE ENGINEERING Unit-3SIMONTHOMAS S
 
Object oriented-systems-development-life-cycle ppt
Object oriented-systems-development-life-cycle pptObject oriented-systems-development-life-cycle ppt
Object oriented-systems-development-life-cycle pptKunal Kishor Nirala
 
Software project management Improving Team Effectiveness
Software project management Improving Team EffectivenessSoftware project management Improving Team Effectiveness
Software project management Improving Team EffectivenessREHMAT ULLAH
 

What's hot (20)

College Management System Project
College Management System ProjectCollege Management System Project
College Management System Project
 
Oracle Forms Introduction
Oracle Forms IntroductionOracle Forms Introduction
Oracle Forms Introduction
 
MySQL 5.7 + JSON
MySQL 5.7 + JSONMySQL 5.7 + JSON
MySQL 5.7 + JSON
 
Class notes
Class notesClass notes
Class notes
 
Use Case diagram-UML diagram-1
Use Case diagram-UML diagram-1Use Case diagram-UML diagram-1
Use Case diagram-UML diagram-1
 
Abc cycle in sw architecture ashish
Abc cycle  in sw architecture ashishAbc cycle  in sw architecture ashish
Abc cycle in sw architecture ashish
 
UML Diagrams for Real estate management system
UML Diagrams for Real estate management systemUML Diagrams for Real estate management system
UML Diagrams for Real estate management system
 
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
Data Models [DATABASE SYSTEMS: Design, Implementation, and Management]
 
Big Data with MySQL
Big Data with MySQLBig Data with MySQL
Big Data with MySQL
 
entity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptentity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.ppt
 
Online property management system design document
Online property management system design documentOnline property management system design document
Online property management system design document
 
dbms notes.ppt
dbms notes.pptdbms notes.ppt
dbms notes.ppt
 
Reconstructing Software Architecture
Reconstructing Software ArchitectureReconstructing Software Architecture
Reconstructing Software Architecture
 
E commerce use case documentation.
E commerce use case documentation.E commerce use case documentation.
E commerce use case documentation.
 
Student result management system
Student result management systemStudent result management system
Student result management system
 
NOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQLNOSQL- Presentation on NoSQL
NOSQL- Presentation on NoSQL
 
Enhanced ER(database)
Enhanced ER(database)Enhanced ER(database)
Enhanced ER(database)
 
CS8494 SOFTWARE ENGINEERING Unit-3
CS8494 SOFTWARE ENGINEERING Unit-3CS8494 SOFTWARE ENGINEERING Unit-3
CS8494 SOFTWARE ENGINEERING Unit-3
 
Object oriented-systems-development-life-cycle ppt
Object oriented-systems-development-life-cycle pptObject oriented-systems-development-life-cycle ppt
Object oriented-systems-development-life-cycle ppt
 
Software project management Improving Team Effectiveness
Software project management Improving Team EffectivenessSoftware project management Improving Team Effectiveness
Software project management Improving Team Effectiveness
 

Viewers also liked (6)

Srs
SrsSrs
Srs
 
Machine Learning and Data Mining: 14 Evaluation and Credibility
Machine Learning and Data Mining: 14 Evaluation and CredibilityMachine Learning and Data Mining: 14 Evaluation and Credibility
Machine Learning and Data Mining: 14 Evaluation and Credibility
 
Erd optionality
Erd optionalityErd optionality
Erd optionality
 
Insurance management system report on visual basic
Insurance management system report on visual basicInsurance management system report on visual basic
Insurance management system report on visual basic
 
A Project Report on Insurance System with Tracking Manager
 A Project Report on Insurance System with Tracking Manager  A Project Report on Insurance System with Tracking Manager
A Project Report on Insurance System with Tracking Manager
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagram
 

Similar to Entity relationship modelling - DE L300

ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSRubal Sagwal
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelSlideshare
 
entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptxThangamaniR3
 
ICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdfICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdfInfotech27
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).pptIshuIswarya3
 
Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER DiagramsAdri Jovin
 
IT6701-Information Management Unit 1
IT6701-Information Management Unit 1IT6701-Information Management Unit 1
IT6701-Information Management Unit 1SIMONTHOMAS S
 
E-R model unit(Iv)
E-R model unit(Iv)E-R model unit(Iv)
E-R model unit(Iv)PadmapriyaA6
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide sharefanta teferi
 
Module 1 session 5
Module 1   session 5Module 1   session 5
Module 1 session 5raghuinfo
 
Unit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxUnit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxMaryJoseph79
 

Similar to Entity relationship modelling - DE L300 (20)

ERD.ppt
ERD.pptERD.ppt
ERD.ppt
 
ERD.ppt
ERD.pptERD.ppt
ERD.ppt
 
Erd1
Erd1Erd1
Erd1
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptx
 
ICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdfICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdf
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).ppt
 
Introduction to ER Diagrams
Introduction to ER DiagramsIntroduction to ER Diagrams
Introduction to ER Diagrams
 
Database part3-
Database part3-Database part3-
Database part3-
 
IT6701-Information Management Unit 1
IT6701-Information Management Unit 1IT6701-Information Management Unit 1
IT6701-Information Management Unit 1
 
2 er
2 er2 er
2 er
 
Unit_2.pdf
Unit_2.pdfUnit_2.pdf
Unit_2.pdf
 
E-R model unit(Iv)
E-R model unit(Iv)E-R model unit(Iv)
E-R model unit(Iv)
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide share
 
Module 1 session 5
Module 1   session 5Module 1   session 5
Module 1 session 5
 
Database design
Database designDatabase design
Database design
 
Unit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptxUnit 2_DBMS_10.2.22.pptx
Unit 2_DBMS_10.2.22.pptx
 
ER MODEL.pptx
ER MODEL.pptxER MODEL.pptx
ER MODEL.pptx
 

More from Edwin Ayernor

Database develoment process - DE L300
Database develoment process - DE L300Database develoment process - DE L300
Database develoment process - DE L300Edwin Ayernor
 
Networs and telecommunication - DE L200
Networs and telecommunication - DE L200Networs and telecommunication - DE L200
Networs and telecommunication - DE L200Edwin Ayernor
 
It management1 - DE L200
It management1 - DE L200It management1 - DE L200
It management1 - DE L200Edwin Ayernor
 
Computers part 2 DE L200
Computers   part 2 DE L200Computers   part 2 DE L200
Computers part 2 DE L200Edwin Ayernor
 

More from Edwin Ayernor (6)

Database develoment process - DE L300
Database develoment process - DE L300Database develoment process - DE L300
Database develoment process - DE L300
 
Networs and telecommunication - DE L200
Networs and telecommunication - DE L200Networs and telecommunication - DE L200
Networs and telecommunication - DE L200
 
It management1 - DE L200
It management1 - DE L200It management1 - DE L200
It management1 - DE L200
 
Computers part 2 DE L200
Computers   part 2 DE L200Computers   part 2 DE L200
Computers part 2 DE L200
 
Computers part 1
Computers   part 1Computers   part 1
Computers part 1
 
Computers part 1
Computers   part 1Computers   part 1
Computers part 1
 

Recently uploaded

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024The Digital Insurer
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Zilliz
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...Zilliz
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdfSandro Moreira
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfOrbitshub
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Victor Rentea
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...apidays
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 

Recently uploaded (20)

Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdfRising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
Rising Above_ Dubai Floods and the Fortitude of Dubai International Airport.pdf
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 

Entity relationship modelling - DE L300

  • 1. Entity 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. 1
  • 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) 2
  • 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. 3
  • 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 4
  • 5. Chen Notation Association between the instances of one or more entity types EntityName Person, place, object, event or concept about which data is to be maintained Represents a set or collection of objects in the real world that share the same properties Verb Phrase AttributeName named property or characteristic of an entity
  • 6. Crow’s Foot Notation Entity Attribute EntityName EntityName List of Attributes Acceptable Relationship Verb phrase
  • 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. 7
  • 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. 8
  • 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 9
  • 10. 2.2.2 Referential Attributes • Make Reference to another instance in another table Referential attribute: Ties the lecturer entity to another entity that is department. 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. 10
  • 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. Relationship name: writes Author Book An author writes one or more books A book can be written by one or more authors. 12
  • 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 13
  • 14. 2.4 Cardinality and Connectivity • Relationships can be classified as either • one – to – one • one – to – many • many – to –many Connectivity • Cardinality : minimum and maximum number of instances of Entity B that can (or must be) associated with each instance of entity A. 14
  • 15. 2.4 Cardinality and Connectivity Professor Professor teaches teaches Class Class A professor teaches class OR A class is taught by professor How Many?? 15
  • 16. 2.4 Cardinality and Connectivity Connectivity 1 Professor M teaches (1,4) Class (1,1) Cardinality Connectivity teaches Professor (1,1) Class (1,4) Cardinality 16
  • 17. 2.4.1 Connectivity • Chen Model – 1 to represent one. – M to represent many 1 M • Crow’s Foot One Mandatory one , means (1,1) many One or many Optional? – we’ll see after this 17
  • 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 18
  • 19. The Implemented 1:M relationship between PAINTER and PAINTING
  • 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 20
  • 21. The 1:1 Relationship Between PROFESSOR and DEPARTMENT
  • 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. 23
  • 24. The M:N Relationship Between STUDENT and CLASS Bowser Smithson Accounting 1 (ACCT-211) Intro to Microcomputing (CIS-220) Intro to Statistics (QM-261) This CANNOT be implemented as shown next…..
  • 25. The tables have many redundancies!! + CLASS_CODE CLASS_CODE + STU_NUM
  • 26. Changing the M:N relationship to TWO 1:M relationships
  • 27. 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. Foreign keys reference the primary keys in the other tables of which it has a relationship with Converting the M:N relationship into TWO 1:M relationships
  • 28. 2.6 Mandatory vs. Optional Cardinalities • Specifies whether an instance must exist or can be absent in the relationship Mandatory Optional handles Lecturer (1,1) (0,N) M 1 Lecturer Class handles (0,N) Class (1,1) A Lecturer may handle zero or many classes. A class is handled by one and only one Lecturer. 28
  • 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 29
  • 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. 30
  • 31. Example: M Member N Searches Books 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. 31