SlideShare a Scribd company logo
1 of 27
Download to read offline
UNIT 1
Lecture 7
E R Model
ER diagram with cardinality limits
• E-R diagrams also provide a way to indicate more
complex constraints on the number of times each
entity participates in relationships in a relationship
set.
• An edge between an entity set and a binary
relationship set can have an associated minimum and
maximum cardinality, shown in the form m..n, where
m is the minimum and n the maximum cardinality.
Dinesh Kumar Bhawnani, BIT DURG
ER diagram with cardinality limits
• A minimum value of 0 indicates partial participation of the
entity set in the relationship set.
• A minimum value of m indicates total participation of the
entity set in the relationship set.
• A maximum value of m indicates that the entity participates
in at most one relationship, while a maximum value *
indicates no limit.
• Note that a label m..* on an edge is equivalent to a double
line.
Dinesh Kumar Bhawnani, BIT DURG
ER diagram with cardinality limits
Dinesh Kumar Bhawnani, BIT DURG
ER diagram with cardinality limits
Dinesh Kumar Bhawnani, BIT DURG
CUSTOMER LOANborrower
Customer_Id
Customer_Name Customer_Street
Customer_City
Loan_Number Amount
Weak and Strong Entity Sets
• An entity set may not have sufficient attributes to form a primary
key. Such an entity set is termed a weak entity set.
• An entity set that has a primary key is termed a strong entity set.
• For e.g., consider the entity set payment, which has the three
attributes: payment-number, payment-date, and payment-
amount. Payment numbers are typically sequential numbers,
starting from 1, generated separately for each loan. Thus,
although each payment entity is distinct, payments for different
loans may share the same payment number. Thus, this entity set
does not have a primary key; it is a weak entity set.
Dinesh Kumar Bhawnani, BIT DURG
Weak and Strong Entity Sets
Dinesh Kumar Bhawnani, BIT DURG
Weak and Strong Entity Sets
Dinesh Kumar Bhawnani, BIT DURG
L1, 1 MILLION
L2, 2 MILLION
L3, 2 MILLION
-
-
-
-
1,10000
2, 10000
3, 10000
1, 50000
2, 50000
LOAN Loan-payment PAYMENT
Weak and Strong Entity Sets
• For a weak entity set to be meaningful, it must be
associated with another entity set, called the
identifying or owner entity set.
• Every weak entity must be associated with an
identifying entity; that is, the weak entity set is said to
be existence dependent on the identifying entity set.
• The identifying entity set is said to own the weak
entity set that it identifies.
Dinesh Kumar Bhawnani, BIT DURG
Weak and Strong Entity Sets
• The relationship associating the weak entity set with the
identifying entity set is called the identifying relationship.
• The identifying relationship is many to one from the weak
entity set to the identifying entity set, and the participation
of the weak entity set in the relationship is total.
• In our example, the identifying entity set for payment is loan,
and a relationship loan-payment that associates payment
entities with their corresponding loan entities is the
identifying relationship.
Dinesh Kumar Bhawnani, BIT DURG
Weak and Strong Entity Sets
• Although a weak entity set does not have a primary key, we
nevertheless need a means of distinguishing among all those
entities in the weak entity set that depend on one particular
strong entity.
• The discriminator of a weak entity set is a set of attributes
that allows this distinction to be made.
• For e.g., the discriminator of the weak entity set payment is
the attribute payment-number, since, for each loan, a
payment number uniquely identifies one single payment for
that loan.
Dinesh Kumar Bhawnani, BIT DURG
Weak and Strong Entity Sets
• The discriminator of a weak entity set is also called the
partial key of the entity set.
• The primary key of a weak entity set is formed by the
primary key of the identifying entity set, plus the weak entity
set’s discriminator.
• In the case of the entity set payment, its primary key is {loan-
number, payment-number}, where loan-number is the
primary key of the identifying entity set, namely loan, and
payment-number distinguishes payment entities within the
same loan.
Dinesh Kumar Bhawnani, BIT DURG
Weak and Strong Entity Sets
• The identifying relationship set should have no descriptive attributes, since
any required attributes can be associated with the weak entity set.
• A weak entity set can participate in relationships other than the identifying
relationship.
• A weak entity set may participate as owner in an identifying relationship
with another weak entity set.
• It is also possible to have a weak entity set with more than one identifying
entity set. A particular weak entity would then be identified by a
combination of entities, one from each identifying entity set.
• The primary key of the weak entity set would consist of the union of the
primary keys of the identifying entity sets, plus the discriminator of the
weak entity set.
Dinesh Kumar Bhawnani, BIT DURG
GATE Question
• Which of the following is used to represent the supporting many-one
relationships of a weak entity set in an entity-relationship diagram?
A. Diamonds with double/ bold border
B. Rectangles with double/ bold border
C. Ovals with double/ bold border
D. Ovals that contain underlined identifiers
[GATE 2020 CS/ IT, IIT DELHI]
Dinesh Kumar Bhawnani, BIT DURG
Steps in ER Modelling
•Usually the following five steps are followed to
generate ER models
1.Identify the entity set.
2.Identify the relevant attributes.
3.Identify the prime attribute.
4.Find relationships between entity set.
5.Draw a complete ER model.
Dinesh Kumar Bhawnani, BIT DURG
Question 1
• Draw an ER Model for an University database application
where
a) A University has many departments.
b) Each department has multiple instructors; one among
them is the head of the department.
c) An instructor belongs to only one department.
d) Each department offers multiple courses, each of which
is taught by a single instructor.
e) A student may enroll for many courses offered by
different departments.
Dinesh Kumar Bhawnani, BIT DURG
Step 1: Identify the entity set
• From the given question, we can identify the following entity
sets.
1. DEPARTMENT
2. COURSE
3. INSTRUCTOR
4. STUDENT
• “Head of the department” is NOT an entity set; it is
relationship between the INSTRUCTOR and DEPARTMENT
entities.
Dinesh Kumar Bhawnani, BIT DURG
Step 2: Identify the relevant attributes
• For the DEPARTMENT entity set the relevant attributes
are Dept_No, Dept_Name and Location.
• For the COURSE entity set the relevant attributes are
Course_No, Course_Name, Duration, and Pre-requisite.
• For the INSTRUCTOR entity set the relevant attributes are
Inst_Id, Inst_Name, Room_No, and Telephone_No.
• For the STUDENT entity set the relevant attributes are
Student_No, Student_Name, and Dob.
Dinesh Kumar Bhawnani, BIT DURG
Step 3: Identify the Prime (key) attribute
•Dept_No is the key attribute for DEPARTMENT
entity set.
•Course_No is the key attribute for COURSE entity
set.
•Inst_Id is the key attribute for INSTRUCTOR
entity set.
•Student_No is the key attribute for STUDENT
entity set.
Dinesh Kumar Bhawnani, BIT DURG
Step 4: Identify the relationship between
entity sets
1. Each department has multiple instructors and an instructor
belongs to only one department.
Dinesh Kumar Bhawnani, BIT DURG
DEPARTMENT INSTRUCTORhas
Step 4: Identify the relationship between
entity sets
2. Each department has multiple instructors; one among
them is the head of the department.
Dinesh Kumar Bhawnani, BIT DURG
DEPARTMENT INSTRUCTORheadedby
Step 4: Identify the relationship between
entity sets
3. Each department offers multiple courses.
Dinesh Kumar Bhawnani, BIT DURG
DEPARTMENT COURSEoffers
Step 4: Identify the relationship between
entity sets
4. Each department offers multiple courses, each of which is
taught by a single instructor.
Dinesh Kumar Bhawnani, BIT DURG
INSTRUCTOR COURSEtaughtby
Step 4: Identify the relationship between
entity sets
5. A student may enroll for many courses offered by different
departments
Dinesh Kumar Bhawnani, BIT DURG
STUDENT COURSEenroll
Step 5: Draw the complete E R Diagram
Dinesh Kumar Bhawnani, BIT DURG
STUDENT
DEPARTMENT
INSTRUCTORCOURSE
Inst_Id
Inst_Name
Room_No
Telephone_No
Stud_No
Stud_Name
Dob
Course_Name
Course_No
Duration
Dept_No Dept_Name
Location
Pre-requisite
enroll
has
headedoffers
taughtby
University Questions
1. Write short notes on
Dinesh Kumar Bhawnani, BIT DURG
For Video lecture on this topic please subscribe to my youtube channel.
The link for my youtube channel is
https://www.youtube.com/channel/UCRWGtE76JlTp1iim6aOTRuw?sub
_confirmation=1
Dinesh Kumar Bhawnani, BIT DURG

More Related Content

What's hot

3.1 tuple relational_calculus
3.1 tuple relational_calculus3.1 tuple relational_calculus
3.1 tuple relational_calculusUtkarsh De
 
Database constraints
Database constraintsDatabase constraints
Database constraintsTony Nguyen
 
DDL And DML
DDL And DMLDDL And DML
DDL And DMLpnp @in
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data StructureAnuj Modi
 
Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management SystemKevin Jadiya
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFOum Saokosal
 
Dbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational ModelDbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational ModelAmiya9439793168
 
Hospital Management system Database design
Hospital Management system Database designHospital Management system Database design
Hospital Management system Database designElias Dinsa
 
Ppt of dbms e r features
Ppt of dbms e r featuresPpt of dbms e r features
Ppt of dbms e r featuresNirali Akabari
 
Degree of relationship set
Degree of relationship setDegree of relationship set
Degree of relationship setMegha Sharma
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalizationUniversity of Potsdam
 
Query Processing, Query Optimization and Transaction
Query Processing, Query Optimization and TransactionQuery Processing, Query Optimization and Transaction
Query Processing, Query Optimization and TransactionPrabu U
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization emailharmeet
 

What's hot (20)

DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
 
trigger dbms
trigger dbmstrigger dbms
trigger dbms
 
3.1 tuple relational_calculus
3.1 tuple relational_calculus3.1 tuple relational_calculus
3.1 tuple relational_calculus
 
Database constraints
Database constraintsDatabase constraints
Database constraints
 
DDL And DML
DDL And DMLDDL And DML
DDL And DML
 
B trees in Data Structure
B trees in Data StructureB trees in Data Structure
B trees in Data Structure
 
Functional dependencies in Database Management System
Functional dependencies in Database Management SystemFunctional dependencies in Database Management System
Functional dependencies in Database Management System
 
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NFDatabase Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
Database Normalization 1NF, 2NF, 3NF, BCNF, 4NF, 5NF
 
Tree in data structure
Tree in data structureTree in data structure
Tree in data structure
 
Dbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational ModelDbms 10: Conversion of ER model to Relational Model
Dbms 10: Conversion of ER model to Relational Model
 
Hospital Management system Database design
Hospital Management system Database designHospital Management system Database design
Hospital Management system Database design
 
Ppt of dbms e r features
Ppt of dbms e r featuresPpt of dbms e r features
Ppt of dbms e r features
 
Degree of relationship set
Degree of relationship setDegree of relationship set
Degree of relationship set
 
Data models
Data modelsData models
Data models
 
Database Keys
Database KeysDatabase Keys
Database Keys
 
Functional dependency and normalization
Functional dependency and normalizationFunctional dependency and normalization
Functional dependency and normalization
 
Query Processing, Query Optimization and Transaction
Query Processing, Query Optimization and TransactionQuery Processing, Query Optimization and Transaction
Query Processing, Query Optimization and Transaction
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
 
Er diagram
Er diagramEr diagram
Er diagram
 
Relational model
Relational modelRelational model
Relational model
 

Similar to Database management system Lecture 7 : Strong and weak entity sets

Dbms Notes Lecture 6 : E R Model, Relationship, Cardinality Ratio
Dbms Notes Lecture 6 : E R Model, Relationship, Cardinality RatioDbms Notes Lecture 6 : E R Model, Relationship, Cardinality Ratio
Dbms Notes Lecture 6 : E R Model, Relationship, Cardinality RatioBIT Durg
 
Entity relationship model
Entity relationship modelEntity relationship model
Entity relationship modelRUpaliLohar
 
Dbms Notes Lecture 5 : E R Model, Entity
Dbms Notes Lecture 5 : E R Model, EntityDbms Notes Lecture 5 : E R Model, Entity
Dbms Notes Lecture 5 : E R Model, EntityBIT Durg
 
Cn presentation on the topic called as re modelling
Cn presentation on the topic called as re modellingCn presentation on the topic called as re modelling
Cn presentation on the topic called as re modellingg30162363
 
Free video lectures for mca
Free video lectures for mcaFree video lectures for mca
Free video lectures for mcaEdhole.com
 
Jobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptxJobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptxprosofts1
 
Conceptual Modeling of Data
Conceptual Modeling of DataConceptual Modeling of Data
Conceptual Modeling of DataM.Zalmai Rahmani
 
BusRules-InterpretingERDs.pptx
BusRules-InterpretingERDs.pptxBusRules-InterpretingERDs.pptx
BusRules-InterpretingERDs.pptxjwell817
 
DBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptxDBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptxparimala123
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSRubal Sagwal
 

Similar to Database management system Lecture 7 : Strong and weak entity sets (20)

Dbms Notes Lecture 6 : E R Model, Relationship, Cardinality Ratio
Dbms Notes Lecture 6 : E R Model, Relationship, Cardinality RatioDbms Notes Lecture 6 : E R Model, Relationship, Cardinality Ratio
Dbms Notes Lecture 6 : E R Model, Relationship, Cardinality Ratio
 
Entity relationship model
Entity relationship modelEntity relationship model
Entity relationship model
 
Er model
Er modelEr model
Er model
 
Dbms Notes Lecture 5 : E R Model, Entity
Dbms Notes Lecture 5 : E R Model, EntityDbms Notes Lecture 5 : E R Model, Entity
Dbms Notes Lecture 5 : E R Model, Entity
 
Cn presentation on the topic called as re modelling
Cn presentation on the topic called as re modellingCn presentation on the topic called as re modelling
Cn presentation on the topic called as re modelling
 
Free video lectures for mca
Free video lectures for mcaFree video lectures for mca
Free video lectures for mca
 
Jobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptxJobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptx
 
Conceptual Modeling of Data
Conceptual Modeling of DataConceptual Modeling of Data
Conceptual Modeling of Data
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
 
27 fcs157al3
27 fcs157al327 fcs157al3
27 fcs157al3
 
BusRules-InterpretingERDs.pptx
BusRules-InterpretingERDs.pptxBusRules-InterpretingERDs.pptx
BusRules-InterpretingERDs.pptx
 
DBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptxDBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptx
 
DBMS Class 3
DBMS Class 3DBMS Class 3
DBMS Class 3
 
Day 1 SQL.pptx
Day 1 SQL.pptxDay 1 SQL.pptx
Day 1 SQL.pptx
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
 
Er diagrams
Er diagramsEr diagrams
Er diagrams
 
Chapter2
Chapter2Chapter2
Chapter2
 
Chapter2
Chapter2Chapter2
Chapter2
 
ERD(2).ppt
ERD(2).pptERD(2).ppt
ERD(2).ppt
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 

Recently uploaded

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Recently uploaded (20)

Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

Database management system Lecture 7 : Strong and weak entity sets

  • 2. ER diagram with cardinality limits • E-R diagrams also provide a way to indicate more complex constraints on the number of times each entity participates in relationships in a relationship set. • An edge between an entity set and a binary relationship set can have an associated minimum and maximum cardinality, shown in the form m..n, where m is the minimum and n the maximum cardinality. Dinesh Kumar Bhawnani, BIT DURG
  • 3. ER diagram with cardinality limits • A minimum value of 0 indicates partial participation of the entity set in the relationship set. • A minimum value of m indicates total participation of the entity set in the relationship set. • A maximum value of m indicates that the entity participates in at most one relationship, while a maximum value * indicates no limit. • Note that a label m..* on an edge is equivalent to a double line. Dinesh Kumar Bhawnani, BIT DURG
  • 4. ER diagram with cardinality limits Dinesh Kumar Bhawnani, BIT DURG
  • 5. ER diagram with cardinality limits Dinesh Kumar Bhawnani, BIT DURG CUSTOMER LOANborrower Customer_Id Customer_Name Customer_Street Customer_City Loan_Number Amount
  • 6. Weak and Strong Entity Sets • An entity set may not have sufficient attributes to form a primary key. Such an entity set is termed a weak entity set. • An entity set that has a primary key is termed a strong entity set. • For e.g., consider the entity set payment, which has the three attributes: payment-number, payment-date, and payment- amount. Payment numbers are typically sequential numbers, starting from 1, generated separately for each loan. Thus, although each payment entity is distinct, payments for different loans may share the same payment number. Thus, this entity set does not have a primary key; it is a weak entity set. Dinesh Kumar Bhawnani, BIT DURG
  • 7. Weak and Strong Entity Sets Dinesh Kumar Bhawnani, BIT DURG
  • 8. Weak and Strong Entity Sets Dinesh Kumar Bhawnani, BIT DURG L1, 1 MILLION L2, 2 MILLION L3, 2 MILLION - - - - 1,10000 2, 10000 3, 10000 1, 50000 2, 50000 LOAN Loan-payment PAYMENT
  • 9. Weak and Strong Entity Sets • For a weak entity set to be meaningful, it must be associated with another entity set, called the identifying or owner entity set. • Every weak entity must be associated with an identifying entity; that is, the weak entity set is said to be existence dependent on the identifying entity set. • The identifying entity set is said to own the weak entity set that it identifies. Dinesh Kumar Bhawnani, BIT DURG
  • 10. Weak and Strong Entity Sets • The relationship associating the weak entity set with the identifying entity set is called the identifying relationship. • The identifying relationship is many to one from the weak entity set to the identifying entity set, and the participation of the weak entity set in the relationship is total. • In our example, the identifying entity set for payment is loan, and a relationship loan-payment that associates payment entities with their corresponding loan entities is the identifying relationship. Dinesh Kumar Bhawnani, BIT DURG
  • 11. Weak and Strong Entity Sets • Although a weak entity set does not have a primary key, we nevertheless need a means of distinguishing among all those entities in the weak entity set that depend on one particular strong entity. • The discriminator of a weak entity set is a set of attributes that allows this distinction to be made. • For e.g., the discriminator of the weak entity set payment is the attribute payment-number, since, for each loan, a payment number uniquely identifies one single payment for that loan. Dinesh Kumar Bhawnani, BIT DURG
  • 12. Weak and Strong Entity Sets • The discriminator of a weak entity set is also called the partial key of the entity set. • The primary key of a weak entity set is formed by the primary key of the identifying entity set, plus the weak entity set’s discriminator. • In the case of the entity set payment, its primary key is {loan- number, payment-number}, where loan-number is the primary key of the identifying entity set, namely loan, and payment-number distinguishes payment entities within the same loan. Dinesh Kumar Bhawnani, BIT DURG
  • 13. Weak and Strong Entity Sets • The identifying relationship set should have no descriptive attributes, since any required attributes can be associated with the weak entity set. • A weak entity set can participate in relationships other than the identifying relationship. • A weak entity set may participate as owner in an identifying relationship with another weak entity set. • It is also possible to have a weak entity set with more than one identifying entity set. A particular weak entity would then be identified by a combination of entities, one from each identifying entity set. • The primary key of the weak entity set would consist of the union of the primary keys of the identifying entity sets, plus the discriminator of the weak entity set. Dinesh Kumar Bhawnani, BIT DURG
  • 14. GATE Question • Which of the following is used to represent the supporting many-one relationships of a weak entity set in an entity-relationship diagram? A. Diamonds with double/ bold border B. Rectangles with double/ bold border C. Ovals with double/ bold border D. Ovals that contain underlined identifiers [GATE 2020 CS/ IT, IIT DELHI] Dinesh Kumar Bhawnani, BIT DURG
  • 15. Steps in ER Modelling •Usually the following five steps are followed to generate ER models 1.Identify the entity set. 2.Identify the relevant attributes. 3.Identify the prime attribute. 4.Find relationships between entity set. 5.Draw a complete ER model. Dinesh Kumar Bhawnani, BIT DURG
  • 16. Question 1 • Draw an ER Model for an University database application where a) A University has many departments. b) Each department has multiple instructors; one among them is the head of the department. c) An instructor belongs to only one department. d) Each department offers multiple courses, each of which is taught by a single instructor. e) A student may enroll for many courses offered by different departments. Dinesh Kumar Bhawnani, BIT DURG
  • 17. Step 1: Identify the entity set • From the given question, we can identify the following entity sets. 1. DEPARTMENT 2. COURSE 3. INSTRUCTOR 4. STUDENT • “Head of the department” is NOT an entity set; it is relationship between the INSTRUCTOR and DEPARTMENT entities. Dinesh Kumar Bhawnani, BIT DURG
  • 18. Step 2: Identify the relevant attributes • For the DEPARTMENT entity set the relevant attributes are Dept_No, Dept_Name and Location. • For the COURSE entity set the relevant attributes are Course_No, Course_Name, Duration, and Pre-requisite. • For the INSTRUCTOR entity set the relevant attributes are Inst_Id, Inst_Name, Room_No, and Telephone_No. • For the STUDENT entity set the relevant attributes are Student_No, Student_Name, and Dob. Dinesh Kumar Bhawnani, BIT DURG
  • 19. Step 3: Identify the Prime (key) attribute •Dept_No is the key attribute for DEPARTMENT entity set. •Course_No is the key attribute for COURSE entity set. •Inst_Id is the key attribute for INSTRUCTOR entity set. •Student_No is the key attribute for STUDENT entity set. Dinesh Kumar Bhawnani, BIT DURG
  • 20. Step 4: Identify the relationship between entity sets 1. Each department has multiple instructors and an instructor belongs to only one department. Dinesh Kumar Bhawnani, BIT DURG DEPARTMENT INSTRUCTORhas
  • 21. Step 4: Identify the relationship between entity sets 2. Each department has multiple instructors; one among them is the head of the department. Dinesh Kumar Bhawnani, BIT DURG DEPARTMENT INSTRUCTORheadedby
  • 22. Step 4: Identify the relationship between entity sets 3. Each department offers multiple courses. Dinesh Kumar Bhawnani, BIT DURG DEPARTMENT COURSEoffers
  • 23. Step 4: Identify the relationship between entity sets 4. Each department offers multiple courses, each of which is taught by a single instructor. Dinesh Kumar Bhawnani, BIT DURG INSTRUCTOR COURSEtaughtby
  • 24. Step 4: Identify the relationship between entity sets 5. A student may enroll for many courses offered by different departments Dinesh Kumar Bhawnani, BIT DURG STUDENT COURSEenroll
  • 25. Step 5: Draw the complete E R Diagram Dinesh Kumar Bhawnani, BIT DURG STUDENT DEPARTMENT INSTRUCTORCOURSE Inst_Id Inst_Name Room_No Telephone_No Stud_No Stud_Name Dob Course_Name Course_No Duration Dept_No Dept_Name Location Pre-requisite enroll has headedoffers taughtby
  • 26. University Questions 1. Write short notes on Dinesh Kumar Bhawnani, BIT DURG
  • 27. For Video lecture on this topic please subscribe to my youtube channel. The link for my youtube channel is https://www.youtube.com/channel/UCRWGtE76JlTp1iim6aOTRuw?sub _confirmation=1 Dinesh Kumar Bhawnani, BIT DURG