SlideShare una empresa de Scribd logo
1 de 32
ER Diagrams
To be discussed:-
 Entity
 Attribute
 Types of Attribute
 Relationship
 ER Diagram Representation
 Generalization
 Specialization
 Inheritance
 Codd’s 12 Rule
 Relational Data Model
 ER Model to Relational Model
Entity
 An entity can be a real-world object, either
animate or inanimate, that can be easily
identifiable. Example : School Database
 Teachers
 Students
 Classes
 Courses offered
Entity set
 An entity set is a collection of similar types of
entities. An entity set may contain entities
with attribute sharing similar values.
Attributes
Entities are represented by means of their properties,
called attributes. All attributes have
values. Example : Student :- Name, Class, Age
Types of Attributes
 Simple attribute − Simple attributes are atomic
values, which cannot be divided further. For
example, a student's phone number is an atomic
value of 10 digits.
 Composite attribute − example, a student's
complete name may have first_name and
last_name.
Types of Attributes Continue…..
 Derived attribute − example, average_salary in a
department should not be saved directly in the database,
instead it can be derived.
 For another example, age can be derived from
data_of_birth.
 Single-value attribute − Single-value attributes contain
single value. example −: Social_Security_Number.
 Multi-value attribute − Multi-value attributes may contain
more than one values.
 Example: a person can have more than one phone
number, email_address, etc.
Relationship
 The association among entities is called
relationship.
 Ex: Employee works_at department
 Ex: Student enrolls in a course
 Relationship Set
A set of relationships of similar type is called a
relationship set. Like entities, a relationship too
can have attributes. These attributes are
called descriptive attributes.
Mapping cardinalities
 Cardinality defines the number of entities in
one entity set, which can be associated with
the number of entities of other set via
relationship set.
 One to one
One to many
Many to one
Many to many
One to One
Entity set A Entity
set B
One to many
Entity set A Entity
set B
Many to one
Entity set A Entity
set B
Many to many
Entity set A Entity
set B
ER Diagram Representation
 Entity
 Attributes
Teacher Student Classes
Studen
t
Nam
e
Roll
Birth_Dat
e
ER Diagram Representation Continue…
 Composite
Studen
t
Nam
e
Roll
Birth_Dat
e
Last
First
ER Diagram Representation Continue…
 Multivalued
Studen
t
Nam
e
Roll
Birth_Dat
e
Last
First
Phone_No
ER Diagram Representation Continue…
 Derived
Studen
t
Nam
e
Roll
Birth_Dat
e
Last
First
Phone_No
Age
ER Diagram Representation Continue…
 Relationship
 Binary Relationship and Cardinality
When two entities participate in a relationship then it
is called Binary Relationship.
Cardinality is the number of instance of an entity from
a relation that can be associated with the relation.
ER Diagram Representation Continue…
 One to One (1:1)
1 1
Example : Person – Passport
Student – Roll-No
Relationshi
p EntityEntity
ER Diagram Representation Continue…
 One to Many (1:N)
1 N
Example : Mother- Children
Student - Address
Relationshi
p EntityEntity
ER Diagram Representation Continue…
 Many to One (N:1)
N 1
Example : Students - Teacher
Relationshi
p EntityEntity
ER Diagram Representation Continue…
 Many to One (M:N)
M N
Example : - Books - Authors
Relationshi
p EntityEntity
ER Diagram Representation Continue…
 Participation Constraint
Total participation Partial participation
Relationshi
p EntityEntity
 The ER Model has the power of expressing
database entities in a conceptual hierarchical
manner. As the hierarchy goes up, it generalizes
the view of entities, and as we go deep in the
hierarchy, it gives us the detail of every entity
included.
Going up in this structure is called Generalization
Reverse is called Specialization
Generalization and Specialization
Generalization
Pigeon
Birds
Peacoc
kSparrow
Specialization
Person
Teache
r
Student
IS A
Inheritance
Person
Nam
e
Gende
r
Birth_Dat
e
Teache
r
Student
EMP_IDRoll
IS A
Relational Data Model
 Relational data model is the primary data model,
which is used widely around the world for data
storage and processing.
 Concepts
 Touple
 Relation Instance
 Relation Schema
 Relation key
 Attribute domain
Key Constraints
 Key constraints
Primary Key
Foreign Key
Candidate Key
Alternate Key
Key Constraints ….
 Key constraints force that −
 in a relation with a key attribute, no two tuples can
have identical values for key attributes.
 a key attribute can not have NULL values.
 Domain constraints
 Every attribute is bound to have a specific range of values.
 Example : Age can not be negative
 Referential integrity constraints
Key Constraints ….
 Referential integrity constraints
Every relation has some conditions that must hold for
it to be a valid relation. These conditions are
called Relational Integrity Constraints.
I If a relation refers to a key attribute of a different or
same relation, then that key element must exist.
ER model to Relational Model
 ER model
 Entity
 Attributes
 Mapping Entity
 Create table for each entity.
 Entity's attributes should become fields of tables with their
respective data types.
 Declare primary key.
ER model to Relational Model
 Mapping Relationship
 Create table for a relationship.
 Add the primary keys of all participating Entities as
fields of table with their respective data types.
 If relationship has any attribute, add each attribute
as field of table.
 Declare a primary key composing all the primary
keys of participating entities.
 Declare all foreign key constraints.
ER model to Relational Model
 Mapping Weak entity set
 Create table for weak entity set.
 Add all its attributes to table as field.
 Add the primary key of identifying entity set.
 Declare all foreign key constraints.

Más contenido relacionado

La actualidad más candente

Database system concepts and architecture
Database system concepts and architectureDatabase system concepts and architecture
Database system concepts and architecture
Jafar Nesargi
 
Codd's rules
Codd's rulesCodd's rules
Codd's rules
Mohd Arif
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
Slideshare
 

La actualidad más candente (20)

DBMS languages/ Types of SQL Commands
DBMS languages/ Types of SQL CommandsDBMS languages/ Types of SQL Commands
DBMS languages/ Types of SQL Commands
 
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
Relational Algebra Ch6 (Navathe 4th edition)/ Ch7 (Navathe 3rd edition)
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptx
 
Chapter 1 introduction to sql server
Chapter 1 introduction to sql serverChapter 1 introduction to sql server
Chapter 1 introduction to sql server
 
Database system concepts and architecture
Database system concepts and architectureDatabase system concepts and architecture
Database system concepts and architecture
 
Codd's rules
Codd's rulesCodd's rules
Codd's rules
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
SQL(DDL & DML)
SQL(DDL & DML)SQL(DDL & DML)
SQL(DDL & DML)
 
Integrity Constraints
Integrity ConstraintsIntegrity Constraints
Integrity Constraints
 
Relational algebra
Relational algebraRelational algebra
Relational algebra
 
4.1 Individual Y 4.3.pptx
4.1 Individual Y 4.3.pptx4.1 Individual Y 4.3.pptx
4.1 Individual Y 4.3.pptx
 
Database-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptxDatabase-management-system-dbms-ppt.pptx
Database-management-system-dbms-ppt.pptx
 
SQL JOIN
SQL JOINSQL JOIN
SQL JOIN
 
Database Management System Introduction
Database Management System IntroductionDatabase Management System Introduction
Database Management System Introduction
 
Coupling and cohesion
Coupling and cohesionCoupling and cohesion
Coupling and cohesion
 
DATA BASE MANAGEMENT SYSTEM BY SAIKIRAN PANJALA
DATA BASE  MANAGEMENT SYSTEM BY SAIKIRAN PANJALADATA BASE  MANAGEMENT SYSTEM BY SAIKIRAN PANJALA
DATA BASE MANAGEMENT SYSTEM BY SAIKIRAN PANJALA
 
Database management system
Database management systemDatabase management system
Database management system
 
SQL Views
SQL ViewsSQL Views
SQL Views
 
DBMS & Data Models - In Introduction
DBMS & Data Models - In IntroductionDBMS & Data Models - In Introduction
DBMS & Data Models - In Introduction
 

Similar a Er diagrams presentation

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
 

Similar a Er diagrams presentation (20)

DBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptxDBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptx
 
Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..
 
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
 
Data model and entity relationship
Data model and entity relationshipData model and entity relationship
Data model and entity relationship
 
Er Modeling
Er ModelingEr Modeling
Er Modeling
 
Design issues with constraints of E-R model
Design issues with constraints of E-R modelDesign issues with constraints of E-R model
Design issues with constraints of E-R model
 
ERD.pptx
ERD.pptxERD.pptx
ERD.pptx
 
5e7ry754.pptx
5e7ry754.pptx5e7ry754.pptx
5e7ry754.pptx
 
Lecture one db
Lecture one dbLecture one db
Lecture one db
 
ER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docxER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docx
 
dbms mannual.pdf
dbms mannual.pdfdbms mannual.pdf
dbms mannual.pdf
 
ER MODEL.pptx
ER MODEL.pptxER MODEL.pptx
ER MODEL.pptx
 
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...
 
Data Modeling Er
Data Modeling ErData Modeling Er
Data Modeling Er
 
ER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMSER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMS
 
Database
DatabaseDatabase
Database
 
Sree Dattha Institute of Engineering and Science
Sree Dattha Institute of Engineering and ScienceSree Dattha Institute of Engineering and Science
Sree Dattha Institute of Engineering and Science
 
ERD(2).ppt
ERD(2).pptERD(2).ppt
ERD(2).ppt
 
Er model
Er modelEr model
Er model
 
Db lec 02_new
Db lec 02_newDb lec 02_new
Db lec 02_new
 

Último

The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
heathfieldcps1
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
KarakKing
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
AnaAcapella
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
ZurliaSoop
 

Último (20)

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Ă...
 
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdfUGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
UGC NET Paper 1 Mathematical Reasoning & Aptitude.pdf
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...Making communications land - Are they received and understood as intended? we...
Making communications land - Are they received and understood as intended? we...
 
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptxSKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
SKILL OF INTRODUCING THE LESSON MICRO SKILLS.pptx
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
Salient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functionsSalient Features of India constitution especially power and functions
Salient Features of India constitution especially power and functions
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 
ICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptxICT Role in 21st Century Education & its Challenges.pptx
ICT Role in 21st Century Education & its Challenges.pptx
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Single or Multiple melodic lines structure
Single or Multiple melodic lines structureSingle or Multiple melodic lines structure
Single or Multiple melodic lines structure
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
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_...
 
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptxBasic Civil Engineering first year Notes- Chapter 4 Building.pptx
Basic Civil Engineering first year Notes- Chapter 4 Building.pptx
 
Spellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please PractiseSpellings Wk 3 English CAPS CARES Please Practise
Spellings Wk 3 English CAPS CARES Please Practise
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
Jual Obat Aborsi Hongkong ( Asli No.1 ) 085657271886 Obat Penggugur Kandungan...
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Spatium Project Simulation student brief
Spatium Project Simulation student briefSpatium Project Simulation student brief
Spatium Project Simulation student brief
 

Er diagrams presentation

  • 2. To be discussed:-  Entity  Attribute  Types of Attribute  Relationship  ER Diagram Representation  Generalization  Specialization  Inheritance  Codd’s 12 Rule  Relational Data Model  ER Model to Relational Model
  • 3. Entity  An entity can be a real-world object, either animate or inanimate, that can be easily identifiable. Example : School Database  Teachers  Students  Classes  Courses offered Entity set  An entity set is a collection of similar types of entities. An entity set may contain entities with attribute sharing similar values.
  • 4. Attributes Entities are represented by means of their properties, called attributes. All attributes have values. Example : Student :- Name, Class, Age Types of Attributes  Simple attribute − Simple attributes are atomic values, which cannot be divided further. For example, a student's phone number is an atomic value of 10 digits.  Composite attribute − example, a student's complete name may have first_name and last_name.
  • 5. Types of Attributes Continue…..  Derived attribute − example, average_salary in a department should not be saved directly in the database, instead it can be derived.  For another example, age can be derived from data_of_birth.  Single-value attribute − Single-value attributes contain single value. example −: Social_Security_Number.  Multi-value attribute − Multi-value attributes may contain more than one values.  Example: a person can have more than one phone number, email_address, etc.
  • 6. Relationship  The association among entities is called relationship.  Ex: Employee works_at department  Ex: Student enrolls in a course  Relationship Set A set of relationships of similar type is called a relationship set. Like entities, a relationship too can have attributes. These attributes are called descriptive attributes.
  • 7. Mapping cardinalities  Cardinality defines the number of entities in one entity set, which can be associated with the number of entities of other set via relationship set.  One to one One to many Many to one Many to many
  • 8. One to One Entity set A Entity set B
  • 9. One to many Entity set A Entity set B
  • 10. Many to one Entity set A Entity set B
  • 11. Many to many Entity set A Entity set B
  • 12. ER Diagram Representation  Entity  Attributes Teacher Student Classes Studen t Nam e Roll Birth_Dat e
  • 13. ER Diagram Representation Continue…  Composite Studen t Nam e Roll Birth_Dat e Last First
  • 14. ER Diagram Representation Continue…  Multivalued Studen t Nam e Roll Birth_Dat e Last First Phone_No
  • 15. ER Diagram Representation Continue…  Derived Studen t Nam e Roll Birth_Dat e Last First Phone_No Age
  • 16. ER Diagram Representation Continue…  Relationship  Binary Relationship and Cardinality When two entities participate in a relationship then it is called Binary Relationship. Cardinality is the number of instance of an entity from a relation that can be associated with the relation.
  • 17. ER Diagram Representation Continue…  One to One (1:1) 1 1 Example : Person – Passport Student – Roll-No Relationshi p EntityEntity
  • 18. ER Diagram Representation Continue…  One to Many (1:N) 1 N Example : Mother- Children Student - Address Relationshi p EntityEntity
  • 19. ER Diagram Representation Continue…  Many to One (N:1) N 1 Example : Students - Teacher Relationshi p EntityEntity
  • 20. ER Diagram Representation Continue…  Many to One (M:N) M N Example : - Books - Authors Relationshi p EntityEntity
  • 21. ER Diagram Representation Continue…  Participation Constraint Total participation Partial participation Relationshi p EntityEntity
  • 22.  The ER Model has the power of expressing database entities in a conceptual hierarchical manner. As the hierarchy goes up, it generalizes the view of entities, and as we go deep in the hierarchy, it gives us the detail of every entity included. Going up in this structure is called Generalization Reverse is called Specialization Generalization and Specialization
  • 26. Relational Data Model  Relational data model is the primary data model, which is used widely around the world for data storage and processing.  Concepts  Touple  Relation Instance  Relation Schema  Relation key  Attribute domain
  • 27. Key Constraints  Key constraints Primary Key Foreign Key Candidate Key Alternate Key
  • 28. Key Constraints ….  Key constraints force that −  in a relation with a key attribute, no two tuples can have identical values for key attributes.  a key attribute can not have NULL values.  Domain constraints  Every attribute is bound to have a specific range of values.  Example : Age can not be negative  Referential integrity constraints
  • 29. Key Constraints ….  Referential integrity constraints Every relation has some conditions that must hold for it to be a valid relation. These conditions are called Relational Integrity Constraints. I If a relation refers to a key attribute of a different or same relation, then that key element must exist.
  • 30. ER model to Relational Model  ER model  Entity  Attributes  Mapping Entity  Create table for each entity.  Entity's attributes should become fields of tables with their respective data types.  Declare primary key.
  • 31. ER model to Relational Model  Mapping Relationship  Create table for a relationship.  Add the primary keys of all participating Entities as fields of table with their respective data types.  If relationship has any attribute, add each attribute as field of table.  Declare a primary key composing all the primary keys of participating entities.  Declare all foreign key constraints.
  • 32. ER model to Relational Model  Mapping Weak entity set  Create table for weak entity set.  Add all its attributes to table as field.  Add the primary key of identifying entity set.  Declare all foreign key constraints.