SlideShare a Scribd company logo
1 of 33
Data Modeling using the
Entity Relationship Model
Chapter 3
Contents
 High-level Conceptual Data Models for
Database design
 Example Database Application
 Entity types, Entity Sets, Attributes and keys
 Relationship types, relationship sets, Roles
and structural Constraints
 E-R Diagram, Naming Conventions and
Design Issues
Example Database Application
 The Company is a organized into
departments. Each Department has unique
name, a unique number and a particular
employee who manages the department. We
keep track of the start date when that
employee began managing the department. A
department has several locations.
 A department controls a number of projects,
each of which has a unique name , a unique
number and a single location.
 We store each employee’s name ,social
security number, address, salary, sex, and
birthdate. An employee is assigned one
department but may work on several projects,
which are not necessarily, controlled by the
same department. We keep track of the
number of hours per week that an employee
works on each project. We also keep track of
the direct supervisor of each employee.
We want to keep track of the
dependents of each employee for
insurance purposes. We keep each
dependent’s first name, sex, birth date,
and relationship to the employee.
Entity Types, Entity Sets, Attributes
and Keys
The basic object that the ER- Model
represents is an entity, which is a “thing”
in real-world with an independent
existence.
An Entity may be an object with physical
existence or may be an object with a
conceptual existence.
Entity Types, Entity Sets, Attributes
and Keys
Each Entity has attributes- the properties
that describe it.
There are several types of attributes
Simple versus Composite
Single valued versus Multivalued
Stored Versus Derived
Composite Versus Simple Attributes
Composite attributes can be divided into
smaller subparts, which represents more
basic attributes with independent
meaning.
For example: Address can be sub
divided into streetaddress, city,
state,country,zip.
Attributes that are not divisible are called
Simple or atomic attributes
Single Valued versus Multivalued
Attributes
Attributes that hold single value are
called single-valued attributes.
For example :age
Multivalued attributes hold more than
one value.
For example: car with two colors, or phone
no of a person
Attributes which are derived from some
other attributes are called as derived
attributes.
The attributes from which others
attributes are derived are called stored
attributes.
For ex: Age is derived from BirthDate, so
age is derived attribute and Birth Date is
stored attribute.
Stored versus Derived Attributes
Null Values
In some cases entity may not have an
applicable value for an attribute.
For Example: Fax Number or apartment
number.
For such attributes an special attribute
called null is created.
Null Means unknown .
Complex Attributes
The composition of composite and
multivalued attributes is called as
complex attributes.
Composite attributes are represented by
() paranthesis and multivalued attributes
{ }.
Entity Types, Entity Sets
A Database usually contains groups of
entities that are similar.
For Example, a company hiring
hundreds of employees may want to
store similar information
These entities share same attributes, but
have their own values for eac attributes.
Entity Type, Entity Sets
An Entity Type defines a collection of
entities that have same attributes.
The collection of all the entities of a
particular entity type in the database at
any point in time is called an entity set.
Entity type is represented as a
Rectangular box in ER Diagrams
enclosing entity type name.
Entity types , Entity Sets
Attributes names are enclosed in ovals
and are attached to their entity type by
straight lines.
Multivalued attributes are displayed in
double ovals.
Key attributes
 An Entity type has an attribute whose values
are distinct for each individual entity in the
entity set. Such attributes are called key
attributes.
 For example: Roll no in Student table.
 Sometimes several attributes together form a
key,meaning that combination of the attribute
will identify the entities in an entity set.
 Such an combination of attributes is called as
Composite attribute.
Value Sets(Domains) of Attributes
Each simple attribute in an entity set is
associated with an value se or domain ,
which specifies the set of values that it
may hold.
Value sets are typically specified using
the basic data types such as integer,
boolean, floating,enumeration,sub range
and so on.
Initial Conceptual Design of
Company Database
An entity type DEPARTMENT with
attributes Name, Number, Locations,
Manager, and ManagerStartDate.
Locations is only multivalued attribute.
We can specify both name and number
as key attributes.
Initial Conceptual Design of
Company Database
An entity type PROJECT with attributes
Name, Number, Location,and
ControllingDepartment.
Both Name and Number are key
attributes.
Initial Conceptual Design of
Company Database
An Entity EMPLOYEE with attributes
Name, SSN,Sex, Address, Salary,
BirthDate, Department, and Supervisor.
Both Name and address may be
composite attributes; however this was
not specified in requirements.
Initial Conceptual Design of
Company Database
An Entity type DEPENDENT with
attributes Employee, DependentName,
Sex, BirthDate and Relationship(to the
employee)
Relationship types, Relations Sets
and Structural Constraints
Degree of a relationship type: The
degree of a relationship type is the
number of participating entity types.
For Example: WORKSFOR relationship
is of degree two.
A relationship type of degree two is
called binary.
A relationship type of degree three is
called ternary.
Relationship as Attributes
It is sometimes convenient to think of a
relationship type in terms of attributes.
ManagerStartDate is an attribute which
is necessary for both Employee and
Department.
Role Names
The role name signifies the role that a
participating entity from the entity type
plays in each relationship instance and
helps to explain what the relationship
means.
For example: In WORKS_FOR
relationship type, EMPLOYEE plays the
role of employee and DEPARTMENT
plays a role of employer
Recursive Relationships
In Some cases the same entity type
participates in a relationship type in
different roles.
Such relationships are called Recursive
Relationships.
For such relationships the role name
becomes essential for distinguishing the
meaning of each participation.
Constraints of Relationship Types
Cardinality Ratios for Binary Relationship
The cardinality ratio for a binary relationship
specifies the maximum number of
relationship instances that an entity can
participate in.
For Example: Works _For Relationship is
between EMPLOYEE and DEPARTMENT
Its Cardinality ratio is 1:N
Possible Cardinality ratios for binary
relationships are 1:1,1:N,N:1,and M:N.
Participation Constraint
Specifies whether the existance of an
entity depends on its being related to
another entity via the relationship type.
There are 2 possible participation
constraints
Total
Partial
Weak Entity Types
 Entity types that do not have key attributes of
their own are called weak entity types.
 In contrast regular entity types that do have
key attributes are called strong entity types.
 Entities belonging to a weak entity type is are
identified by strong entity types and the
relation ship is called identifying relationship
ER Diagram Naming Conventions
ER Diagram Naming Conventions
E-R Diagram For Company Schema
Proper Naming of Schema
Constructs
Use Singular Names for Entity Types
rather than plurals because entity type
applies to each individual entity.
Entity Type names and relationship
types are written in uppercase.
Attribute names are capitilized
Role names are in lower case.

More Related Content

What's hot

2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
koolkampus
 
Object oriented database model
Object oriented database modelObject oriented database model
Object oriented database model
PAQUIAAIZEL
 
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
Tech_MX
 
Lecture 01 introduction to database
Lecture 01 introduction to databaseLecture 01 introduction to database
Lecture 01 introduction to database
emailharmeet
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
koolkampus
 

What's hot (20)

2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS2. Entity Relationship Model in DBMS
2. Entity Relationship Model in DBMS
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Data models
Data modelsData models
Data models
 
data modeling and models
data modeling and modelsdata modeling and models
data modeling and models
 
Object oriented database model
Object oriented database modelObject oriented database model
Object oriented database model
 
Dbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design IssueDbms 7: ER Diagram Design Issue
Dbms 7: ER Diagram Design Issue
 
Relational database
Relational database Relational database
Relational database
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
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
 
Elmasri Navathe DBMS Unit-1 ppt
Elmasri Navathe DBMS Unit-1 pptElmasri Navathe DBMS Unit-1 ppt
Elmasri Navathe DBMS Unit-1 ppt
 
Lecture 01 introduction to database
Lecture 01 introduction to databaseLecture 01 introduction to database
Lecture 01 introduction to database
 
DBMS PPT
DBMS PPTDBMS PPT
DBMS PPT
 
Database System Architectures
Database System ArchitecturesDatabase System Architectures
Database System Architectures
 
OODM-object oriented data model
OODM-object oriented data modelOODM-object oriented data model
OODM-object oriented data model
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Relational Data Model Introduction
Relational Data Model IntroductionRelational Data Model Introduction
Relational Data Model Introduction
 
Primary Key & Foreign Key part10
Primary Key & Foreign Key part10Primary Key & Foreign Key part10
Primary Key & Foreign Key part10
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
 
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
FUNCTION DEPENDENCY  AND TYPES & EXAMPLEFUNCTION DEPENDENCY  AND TYPES & EXAMPLE
FUNCTION DEPENDENCY AND TYPES & EXAMPLE
 

Viewers also liked

3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model
Kumar
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
Slideshare
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
tameemyousaf
 
Data flow diagram
Data flow diagram Data flow diagram
Data flow diagram
Nidhi Sharma
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
tameemyousaf
 
Database system concepts and architecture
Database system concepts and architectureDatabase system concepts and architecture
Database system concepts and architecture
Jafar Nesargi
 
Dbms lab 01 termwork1
Dbms lab 01 termwork1Dbms lab 01 termwork1
Dbms lab 01 termwork1
Jafar Nesargi
 
A method for filtering large conceptual schemas
A method for filtering large conceptual schemasA method for filtering large conceptual schemas
A method for filtering large conceptual schemas
Antonio Villegas
 

Viewers also liked (20)

3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model3 data modeling using the entity-relationship (er) model
3 data modeling using the entity-relationship (er) model
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Entity Relationship Diagram2
Entity Relationship Diagram2Entity Relationship Diagram2
Entity Relationship Diagram2
 
Data Modeling PPT
Data Modeling PPTData Modeling PPT
Data Modeling PPT
 
Data Modeling Using the EntityRelationship (ER) Model
Data Modeling Using the EntityRelationship (ER) ModelData Modeling Using the EntityRelationship (ER) Model
Data Modeling Using the EntityRelationship (ER) Model
 
03 Ch3 Notes Revised
03 Ch3 Notes Revised03 Ch3 Notes Revised
03 Ch3 Notes Revised
 
IT Certifications in Demand for 2012 | Best Certs to Get a Job
IT Certifications in Demand for 2012 | Best Certs to Get a JobIT Certifications in Demand for 2012 | Best Certs to Get a Job
IT Certifications in Demand for 2012 | Best Certs to Get a Job
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
Data flow diagram
Data flow diagram Data flow diagram
Data flow diagram
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
Database system concepts and architecture
Database system concepts and architectureDatabase system concepts and architecture
Database system concepts and architecture
 
Dbms lab 01 termwork1
Dbms lab 01 termwork1Dbms lab 01 termwork1
Dbms lab 01 termwork1
 
A method for filtering large conceptual schemas
A method for filtering large conceptual schemasA method for filtering large conceptual schemas
A method for filtering large conceptual schemas
 
E r model
E r modelE r model
E r model
 
Delegation, Decentralization and centrlization
Delegation, Decentralization and centrlizationDelegation, Decentralization and centrlization
Delegation, Decentralization and centrlization
 
Conceptual Modeling of Data
Conceptual Modeling of DataConceptual Modeling of Data
Conceptual Modeling of Data
 
Entity Relationship diagrams - ER diagrams
Entity Relationship diagrams - ER diagramsEntity Relationship diagrams - ER diagrams
Entity Relationship diagrams - ER diagrams
 
Computer basics Intro
Computer basics IntroComputer basics Intro
Computer basics Intro
 
The Data Cleansing Process - A Roadmap to Material Master Data Quality
The Data Cleansing Process - A Roadmap to Material Master Data QualityThe Data Cleansing Process - A Roadmap to Material Master Data Quality
The Data Cleansing Process - A Roadmap to Material Master Data Quality
 
UAE Police & Military Hostile Environs Security Training Project V
UAE Police & Military Hostile Environs Security Training Project VUAE Police & Military Hostile Environs Security Training Project V
UAE Police & Military Hostile Environs Security Training Project V
 

Similar to Data modeling using the entity relationship model

ECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptxECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptx
miftah88
 
Entity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptxEntity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptx
sukrithlal008
 
Pertemuan-4------------------------------------------------
Pertemuan-4------------------------------------------------Pertemuan-4------------------------------------------------
Pertemuan-4------------------------------------------------
keishaangelina2
 

Similar to Data modeling using the entity relationship model (20)

Chapter3
Chapter3Chapter3
Chapter3
 
Chapter3
Chapter3Chapter3
Chapter3
 
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
 
Jobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptxJobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptx
 
27 fcs157al3
27 fcs157al327 fcs157al3
27 fcs157al3
 
ERD with complete knowledge
ERD with complete knowledgeERD with complete knowledge
ERD with complete knowledge
 
3. Chapter Three.pdf
3. Chapter Three.pdf3. Chapter Three.pdf
3. Chapter Three.pdf
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Basic concepts of Data and Databases
Basic concepts of Data and Databases Basic concepts of Data and Databases
Basic concepts of Data and Databases
 
02er
02er02er
02er
 
database1
database1database1
database1
 
Chapter-3 Data Modeling Using the Entity-Relationship Model
Chapter-3  Data Modeling Using the Entity-Relationship ModelChapter-3  Data Modeling Using the Entity-Relationship Model
Chapter-3 Data Modeling Using the Entity-Relationship Model
 
ECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptxECEG 4702-Class7-Entity-Relationship modeling.pptx
ECEG 4702-Class7-Entity-Relationship modeling.pptx
 
DBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptxDBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptx
 
Chapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptxChapter 2. Concepctual design -.pptx
Chapter 2. Concepctual design -.pptx
 
E R Model details.ppt
E R Model details.pptE R Model details.ppt
E R Model details.ppt
 
Entity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptxEntity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptx
 
Unit02 dbms
Unit02 dbmsUnit02 dbms
Unit02 dbms
 
Pertemuan-4------------------------------------------------
Pertemuan-4------------------------------------------------Pertemuan-4------------------------------------------------
Pertemuan-4------------------------------------------------
 
Unit 3 final.pptx
Unit 3 final.pptxUnit 3 final.pptx
Unit 3 final.pptx
 

More from Jafar Nesargi

Chapter 7 relation database language
Chapter 7 relation database languageChapter 7 relation database language
Chapter 7 relation database language
Jafar Nesargi
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
Jafar Nesargi
 
Chapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organizationChapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organization
Jafar Nesargi
 
Introduction to-oracle
Introduction to-oracleIntroduction to-oracle
Introduction to-oracle
Jafar Nesargi
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
Jafar Nesargi
 
Session1 gateway to web page development
Session1   gateway to web page developmentSession1   gateway to web page development
Session1 gateway to web page development
Jafar Nesargi
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
Jafar Nesargi
 
Record storage and primary file organization
Record storage and primary file organizationRecord storage and primary file organization
Record storage and primary file organization
Jafar Nesargi
 
Introduction to-oracle
Introduction to-oracleIntroduction to-oracle
Introduction to-oracle
Jafar Nesargi
 
Relational database language
Relational database languageRelational database language
Relational database language
Jafar Nesargi
 

More from Jafar Nesargi (20)

Network adpater,cabel,cards ,types, network devices
Network adpater,cabel,cards ,types, network devicesNetwork adpater,cabel,cards ,types, network devices
Network adpater,cabel,cards ,types, network devices
 
An introduction to networking
An introduction to networkingAn introduction to networking
An introduction to networking
 
Css
CssCss
Css
 
Chapter 7 relation database language
Chapter 7 relation database languageChapter 7 relation database language
Chapter 7 relation database language
 
Chapter 6 relational data model and relational
Chapter  6  relational data model and relationalChapter  6  relational data model and relational
Chapter 6 relational data model and relational
 
Chapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organizationChapter 4 record storage and primary file organization
Chapter 4 record storage and primary file organization
 
Introduction to-oracle
Introduction to-oracleIntroduction to-oracle
Introduction to-oracle
 
Chapter2
Chapter2Chapter2
Chapter2
 
Cascading style sheets
Cascading style sheetsCascading style sheets
Cascading style sheets
 
Session1 gateway to web page development
Session1   gateway to web page developmentSession1   gateway to web page development
Session1 gateway to web page development
 
Introduction to jsp
Introduction to jspIntroduction to jsp
Introduction to jsp
 
Chapter 3 servlet & jsp
Chapter 3 servlet & jspChapter 3 servlet & jsp
Chapter 3 servlet & jsp
 
Rmi
RmiRmi
Rmi
 
Java bean
Java beanJava bean
Java bean
 
Networking
NetworkingNetworking
Networking
 
Chapter2 j2ee
Chapter2 j2eeChapter2 j2ee
Chapter2 j2ee
 
Chapter 1 swings
Chapter 1 swingsChapter 1 swings
Chapter 1 swings
 
Record storage and primary file organization
Record storage and primary file organizationRecord storage and primary file organization
Record storage and primary file organization
 
Introduction to-oracle
Introduction to-oracleIntroduction to-oracle
Introduction to-oracle
 
Relational database language
Relational database languageRelational database language
Relational database language
 

Recently uploaded

Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
AnaAcapella
 

Recently uploaded (20)

AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
Sensory_Experience_and_Emotional_Resonance_in_Gabriel_Okaras_The_Piano_and_Th...
 
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPSSpellings Wk 4 and Wk 5 for Grade 4 at CAPS
Spellings Wk 4 and Wk 5 for Grade 4 at CAPS
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
latest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answerslatest AZ-104 Exam Questions and Answers
latest AZ-104 Exam Questions and Answers
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Philosophy of china and it's charactistics
Philosophy of china and it's charactisticsPhilosophy of china and it's charactistics
Philosophy of china and it's charactistics
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
SOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning PresentationSOC 101 Demonstration of Learning Presentation
SOC 101 Demonstration of Learning Presentation
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 

Data modeling using the entity relationship model

  • 1. Data Modeling using the Entity Relationship Model Chapter 3
  • 2. Contents  High-level Conceptual Data Models for Database design  Example Database Application  Entity types, Entity Sets, Attributes and keys  Relationship types, relationship sets, Roles and structural Constraints  E-R Diagram, Naming Conventions and Design Issues
  • 3.
  • 4. Example Database Application  The Company is a organized into departments. Each Department has unique name, a unique number and a particular employee who manages the department. We keep track of the start date when that employee began managing the department. A department has several locations.  A department controls a number of projects, each of which has a unique name , a unique number and a single location.
  • 5.  We store each employee’s name ,social security number, address, salary, sex, and birthdate. An employee is assigned one department but may work on several projects, which are not necessarily, controlled by the same department. We keep track of the number of hours per week that an employee works on each project. We also keep track of the direct supervisor of each employee.
  • 6. We want to keep track of the dependents of each employee for insurance purposes. We keep each dependent’s first name, sex, birth date, and relationship to the employee.
  • 7. Entity Types, Entity Sets, Attributes and Keys The basic object that the ER- Model represents is an entity, which is a “thing” in real-world with an independent existence. An Entity may be an object with physical existence or may be an object with a conceptual existence.
  • 8. Entity Types, Entity Sets, Attributes and Keys Each Entity has attributes- the properties that describe it. There are several types of attributes Simple versus Composite Single valued versus Multivalued Stored Versus Derived
  • 9. Composite Versus Simple Attributes Composite attributes can be divided into smaller subparts, which represents more basic attributes with independent meaning. For example: Address can be sub divided into streetaddress, city, state,country,zip. Attributes that are not divisible are called Simple or atomic attributes
  • 10. Single Valued versus Multivalued Attributes Attributes that hold single value are called single-valued attributes. For example :age Multivalued attributes hold more than one value. For example: car with two colors, or phone no of a person
  • 11. Attributes which are derived from some other attributes are called as derived attributes. The attributes from which others attributes are derived are called stored attributes. For ex: Age is derived from BirthDate, so age is derived attribute and Birth Date is stored attribute. Stored versus Derived Attributes
  • 12. Null Values In some cases entity may not have an applicable value for an attribute. For Example: Fax Number or apartment number. For such attributes an special attribute called null is created. Null Means unknown .
  • 13. Complex Attributes The composition of composite and multivalued attributes is called as complex attributes. Composite attributes are represented by () paranthesis and multivalued attributes { }.
  • 14. Entity Types, Entity Sets A Database usually contains groups of entities that are similar. For Example, a company hiring hundreds of employees may want to store similar information These entities share same attributes, but have their own values for eac attributes.
  • 15. Entity Type, Entity Sets An Entity Type defines a collection of entities that have same attributes. The collection of all the entities of a particular entity type in the database at any point in time is called an entity set. Entity type is represented as a Rectangular box in ER Diagrams enclosing entity type name.
  • 16. Entity types , Entity Sets Attributes names are enclosed in ovals and are attached to their entity type by straight lines. Multivalued attributes are displayed in double ovals.
  • 17. Key attributes  An Entity type has an attribute whose values are distinct for each individual entity in the entity set. Such attributes are called key attributes.  For example: Roll no in Student table.  Sometimes several attributes together form a key,meaning that combination of the attribute will identify the entities in an entity set.  Such an combination of attributes is called as Composite attribute.
  • 18. Value Sets(Domains) of Attributes Each simple attribute in an entity set is associated with an value se or domain , which specifies the set of values that it may hold. Value sets are typically specified using the basic data types such as integer, boolean, floating,enumeration,sub range and so on.
  • 19. Initial Conceptual Design of Company Database An entity type DEPARTMENT with attributes Name, Number, Locations, Manager, and ManagerStartDate. Locations is only multivalued attribute. We can specify both name and number as key attributes.
  • 20. Initial Conceptual Design of Company Database An entity type PROJECT with attributes Name, Number, Location,and ControllingDepartment. Both Name and Number are key attributes.
  • 21. Initial Conceptual Design of Company Database An Entity EMPLOYEE with attributes Name, SSN,Sex, Address, Salary, BirthDate, Department, and Supervisor. Both Name and address may be composite attributes; however this was not specified in requirements.
  • 22. Initial Conceptual Design of Company Database An Entity type DEPENDENT with attributes Employee, DependentName, Sex, BirthDate and Relationship(to the employee)
  • 23. Relationship types, Relations Sets and Structural Constraints Degree of a relationship type: The degree of a relationship type is the number of participating entity types. For Example: WORKSFOR relationship is of degree two. A relationship type of degree two is called binary. A relationship type of degree three is called ternary.
  • 24. Relationship as Attributes It is sometimes convenient to think of a relationship type in terms of attributes. ManagerStartDate is an attribute which is necessary for both Employee and Department.
  • 25. Role Names The role name signifies the role that a participating entity from the entity type plays in each relationship instance and helps to explain what the relationship means. For example: In WORKS_FOR relationship type, EMPLOYEE plays the role of employee and DEPARTMENT plays a role of employer
  • 26. Recursive Relationships In Some cases the same entity type participates in a relationship type in different roles. Such relationships are called Recursive Relationships. For such relationships the role name becomes essential for distinguishing the meaning of each participation.
  • 27. Constraints of Relationship Types Cardinality Ratios for Binary Relationship The cardinality ratio for a binary relationship specifies the maximum number of relationship instances that an entity can participate in. For Example: Works _For Relationship is between EMPLOYEE and DEPARTMENT Its Cardinality ratio is 1:N Possible Cardinality ratios for binary relationships are 1:1,1:N,N:1,and M:N.
  • 28. Participation Constraint Specifies whether the existance of an entity depends on its being related to another entity via the relationship type. There are 2 possible participation constraints Total Partial
  • 29. Weak Entity Types  Entity types that do not have key attributes of their own are called weak entity types.  In contrast regular entity types that do have key attributes are called strong entity types.  Entities belonging to a weak entity type is are identified by strong entity types and the relation ship is called identifying relationship
  • 30. ER Diagram Naming Conventions
  • 31. ER Diagram Naming Conventions
  • 32. E-R Diagram For Company Schema
  • 33. Proper Naming of Schema Constructs Use Singular Names for Entity Types rather than plurals because entity type applies to each individual entity. Entity Type names and relationship types are written in uppercase. Attribute names are capitilized Role names are in lower case.