0% found this document useful (0 votes)
8 views29 pages

03) Data Modeling With ERD

Uploaded by

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

03) Data Modeling With ERD

Uploaded by

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

Entity Design and Data Model Development

Modeling with Entity Relationship Diagram for


developing data analytics systems
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)
Gathering Info. for Conceptual Data Modeling

Two
perspectives

Top-down Bottom-up

Data model is derived from an Data model is derived by


intimate understanding of the reviewing specifications and
business. business documents.
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.
Example:

M N
Member 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.
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 Chen Model & Crow’s Foot Model
 Attributes
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 / defining entities:

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

Arpan 105 ITS Arpan@iit.com

Sanjay 106 STR Sanjay@iit.com


Vignesh 107 ITS Vignesh@iit.com
SP Singh 108 OPS Spsingh@iit.com
Instance of Lecturer.
ERD Notations

08-08-2024 Lecture Presentation | © Dr. A. K. Kar 11


Crow’s Foot Notation

Entity Attribute Relationship

EntityName
EntityName Verb phrase

List of Attributes

Acceptable
Chen Notation
Association between the instances
of one or more entity types

Verb
EntityName Phrase AttributeName

Person, place, object, event or concept named property or


about which data is to be maintained characteristic of an entity

Represents a set or collection of objects in the real world that share the same properties
08-08-2024 Lecture Presentation | © Dr. A. K. Kar 14
08-08-2024 Lecture Presentation | © Dr. A. K. Kar 15
Developing an ERD for System Specification

08-08-2024 Lecture Presentation | © Dr. A. K. Kar 16


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.
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
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.
Cardinality vs Connectivity

Connectivity

1 M
Professor teaches Class

(1,3) (1,1) or (1,2)


Connectivity
Cardinality
teaches
Professor Class

(1,1) (1,3)

Cardinality
Connectivity

One Mandatory one , means (1,1)

many

One or many
Optional? – we’ll see after this
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


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

Bowser Accounting 1 (ACCT-211)

Intro to Microcomputing (CIS-220)


Smithson

Intro to Statistics (QM-261)

This CANNOT be implemented as shown next…..


Changing the M:N relationship to 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
Professor Course
(1,1) (0,N)

M
1
Professor handles Course
(0,N) (1,1)

A Professor may handle zero or many Courses.

A Course is handled by one and only one Professor.


How to Evaluate a Data Model?

Accuracy and completeness


Non redundancy of entities
Enforcement of key business rules
Data Reusability
Stability and Flexibility
Communication Effectiveness
Thank you

08-08-2024 Lecture Presentation | © Dr. A. K. Kar 29

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