SlideShare a Scribd company logo
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 Entity
Entity
ER Diagram Representation Continue…
 One to Many (1:N)
1 N
Example : Mother- Children
Student - Address
Relationshi
p Entity
Entity
ER Diagram Representation Continue…
 Many to One (N:1)
N 1
Example : Students - Teacher
Relationshi
p Entity
Entity
ER Diagram Representation Continue…
 Many to One (M:N)
M N
Example : - Books - Authors
Relationshi
p Entity
Entity
ER Diagram Representation Continue…
 Participation Constraint
Total participation Partial participation
Relationshi
p Entity
Entity
 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
k
Sparrow
Specialization
Person
Teache
r
Student
IS A
Inheritance
Person
Nam
e
Gende
r
Birth_Dat
e
Teache
r
Student
EMP_ID
Roll
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.

More Related Content

Similar to erdiagramspresentation-150826044953-lva1-app6891.pdf

Lecture one db
Lecture one dbLecture one db
Lecture one db
Huda Alameen
 
ER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docxER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docx
KameshwariPurusothma
 
dbms mannual.pdf
dbms mannual.pdfdbms mannual.pdf
dbms mannual.pdf
DevidasBhere
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
MANASINANDKISHORDEOR
 
ER MODEL.pptx
ER MODEL.pptxER MODEL.pptx
ER MODEL.pptx
TusharSingh711352
 
ER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMSER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMS
ssuser20b618
 
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...
Mustafa Kamel Mohammadi
 
Data Modeling Er
Data Modeling ErData Modeling Er
Data Modeling Er
1ajnabi4u
 
Database
DatabaseDatabase
Database
mubeenkiran
 
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
drprkr74
 
Db lec 02_new
Db lec 02_newDb lec 02_new
Db lec 02_new
Ramadan Babers, PhD
 
ERD(2).ppt
ERD(2).pptERD(2).ppt
ERD(2).ppt
Vijaykumar311275
 
Er model
Er modelEr model
Er model
Surkhab Shelly
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptx
sandeep54552
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
Bhandari Nawaraj
 
Entity Relationship Diagram2
Entity Relationship Diagram2Entity Relationship Diagram2
Entity Relationship Diagram2
sadeenedian08
 
Rdbms ER model
Rdbms ER modelRdbms ER model
Rdbms ER model
Uma mohan
 

Similar to erdiagramspresentation-150826044953-lva1-app6891.pdf (20)

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
 
The Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptxThe Entity-Relationship Model(ER Diagram).pptx
The Entity-Relationship Model(ER Diagram).pptx
 
ER MODEL.pptx
ER MODEL.pptxER MODEL.pptx
ER MODEL.pptx
 
ER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMSER DIAGRAM & ER MODELING IN DBMS
ER DIAGRAM & ER MODELING IN DBMS
 
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
 
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
 
Db lec 02_new
Db lec 02_newDb lec 02_new
Db lec 02_new
 
ERD(2).ppt
ERD(2).pptERD(2).ppt
ERD(2).ppt
 
Er model
Er modelEr model
Er model
 
RDBMS ERD
RDBMS ERDRDBMS ERD
RDBMS ERD
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptx
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
 
Entity Relationship Diagram2
Entity Relationship Diagram2Entity Relationship Diagram2
Entity Relationship Diagram2
 
E r model
E r modelE r model
E r model
 
Rdbms ER model
Rdbms ER modelRdbms ER model
Rdbms ER model
 
Data modeling
Data modelingData modeling
Data modeling
 

Recently uploaded

The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
Delapenabediema
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
Celine George
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
Col Mukteshwar Prasad
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
Nguyen Thanh Tu Collection
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
joachimlavalley1
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
rosedainty
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
Celine George
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
RaedMohamed3
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
Atul Kumar Singh
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
MIRIAMSALINAS13
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
EduSkills OECD
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
beazzy04
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
EugeneSaldivar
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
PedroFerreira53928
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
siemaillard
 

Recently uploaded (20)

The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
How to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS ModuleHow to Split Bills in the Odoo 17 POS Module
How to Split Bills in the Odoo 17 POS Module
 
How to Break the cycle of negative Thoughts
How to Break the cycle of negative ThoughtsHow to Break the cycle of negative Thoughts
How to Break the cycle of negative Thoughts
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
Additional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdfAdditional Benefits for Employee Website.pdf
Additional Benefits for Employee Website.pdf
 
Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)Template Jadual Bertugas Kelas (Boleh Edit)
Template Jadual Bertugas Kelas (Boleh Edit)
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
How to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERPHow to Create Map Views in the Odoo 17 ERP
How to Create Map Views in the Odoo 17 ERP
 
Palestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptxPalestine last event orientationfvgnh .pptx
Palestine last event orientationfvgnh .pptx
 
Language Across the Curriculm LAC B.Ed.
Language Across the  Curriculm LAC B.Ed.Language Across the  Curriculm LAC B.Ed.
Language Across the Curriculm LAC B.Ed.
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXXPhrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
Phrasal Verbs.XXXXXXXXXXXXXXXXXXXXXXXXXX
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...TESDA TM1 REVIEWER  FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
TESDA TM1 REVIEWER FOR NATIONAL ASSESSMENT WRITTEN AND ORAL QUESTIONS WITH A...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
PART A. Introduction to Costumer Service
PART A. Introduction to Costumer ServicePART A. Introduction to Costumer Service
PART A. Introduction to Costumer Service
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 

erdiagramspresentation-150826044953-lva1-app6891.pdf

  • 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 Entity Entity
  • 18. ER Diagram Representation Continue…  One to Many (1:N) 1 N Example : Mother- Children Student - Address Relationshi p Entity Entity
  • 19. ER Diagram Representation Continue…  Many to One (N:1) N 1 Example : Students - Teacher Relationshi p Entity Entity
  • 20. ER Diagram Representation Continue…  Many to One (M:N) M N Example : - Books - Authors Relationshi p Entity Entity
  • 21. ER Diagram Representation Continue…  Participation Constraint Total participation Partial participation Relationshi p Entity Entity
  • 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.