SlideShare a Scribd company logo
Entity-Relationship
(E/R) Model
Entity-Relationship (E/R) Model
Widely used conceptual level data model
• proposed by Peter P Chen in 1970s
Data model to describe the database system at the requirements
collection stage
• high level description.
• easy to understand for the enterprise managers.
• rigorous enough to be used for system building.
Concepts available in the model
• entities and attributes of entities.
• relationships between entities.
• diagrammatic notation.
2
Entities
Entity - a thing (animate or inanimate) of independent
physical or conceptual existence and distinguishable.
In the University database context, an individual
student, faculty member, a class room, a course
are entities.
Entity Set or Entity Type-
Collection of entities all having the same properties.
Student entity set – collection of all student entities.
Course entity set – collection of all course entities.
3
Attributes
Each entity is described by a set of attributes/properties.
student entity
StudName – name of the student.
RollNumber – the roll number of the student.
Sex – the gender of the student etc.
All entities in an Entity set/type have the same set of attributes.
Chosen set of attributes – amount of detail in modeling.
4
Types of Attributes (1/2)
• Simple Attributes
having atomic or indivisible values.
example: Dept – a string
PhoneNumber – an eight digit number
• Composite Attributes
having several components in the value.
example: Qualification with components
(DegreeName, Year, UniversityName)
• Derived Attributes
Attribute value is dependent on some other attribute.
example: Age depends on DateOf Birth.
So age is a derived attribute.
5
Types of Attributes (2/2)
• Single-valued
having only one value rather than a set of values.
for instance, PlaceOfBirth – single string value.
• Multi-valued
having a set of values rather than a single value.
for instance, CoursesEnrolled attribute for student
EmailAddress attribute for student
PreviousDegree attribute for student.
• Attributes can be:
simple single-valued, simple multi-valued,
composite single-valued or composite multi-valued.
6
Diagrammatic Notation for Entities
entity - rectangle
attribute - ellipse connected to rectangle
multi-valued attribute - double ellipse
composite attribute - ellipse connected to ellipse
derived attribute - dashed ellipse
Lname
Fname Mname
Program
RollNumber
StudName
Student
Sex
Age
DateOfBirth
AdmissionYear
EmailAddress
7
Domains of Attributes
Each attribute takes values from a set called its domain
For instance, studentAge – {17,18, …, 55}
HomeAddress – character strings of length 35
Domain of composite attributes –
cross product of domains of component attributes
Domain of multi-valued attributes –
set of subsets of values from the basic domain
8
Entity Sets and Key Attributes
• Key – an attribute or a collection of attributes whose value(s)
uniquely identify an entity in the entity set.
• For instance,
• RollNumber - Key for Student entity set
• EmpID - Key for Faculty entity set
• HostelName, RoomNo - Key for Student entity set
(assuming that each student gets to stay in a single room)
• A key for an entity set may have more than one attribute.
• An entity set may have more than one key.
• Keys can be determined only from the meaning of the
attributes in the entity type.
• Determined by the designers
9
Relationships
• When two or more entities are associated with each other,
we have an instance of a Relationship.
• E.g.: student Ramesh enrolls in Discrete Mathematics course
• Relationship enrolls has Student and Course as the
participating entity sets.
• Formally, enrolls ⊆ Student × Course
• (s,c) ∈ enrolls ⇔ Student ‘s’ has enrolled in Course ‘c’
• Tuples in enrolls – relationship instances
• enrolls is called a relationship Type/Set.
10
Degree of a relationship
• Degree : the number of participating entities.
• Degree 2: binary
• Degree 3: ternary
• Degree n: n-ary
• Binary relationships are very common and widely used.
11
Diagrammatic Notation for Relationships
Relationship – diamond shaped box
Rectangle of each participating entity is connected by a line to
this diamond. Name of the relationship is written in the box.
A
R
B
C
12
Binary Relationships and Cardinality Ratio
M
E1 R
N
E2
• The number of entities from E2 that an entity from E1 can
possibly be associated thru R (and vice-versa) determines
the cardinality ratio of R.
• Four possibilities are usually specified:
• one-to-one (1:1)
• one-to-many (1:N)
• many-to-one (N:1)
• many-to-many (M:N)
13
Cardinality Ratios
• One-to-one: An E1 entity may be associated with at
most one E2 entity and similarly
an E2 entity may be associated with at
most one E1 entity.
An E1 entity may be associated with
many E2 entities whereas an E2 entity may
be associated with at most one E1 entity.
… ( similar to above)
Many E1 entities may be associated with a
single E2 entity and a single E1 entity
may be associated with many E2 entities.
• One-to-many:
• Many-to-one:
• Many-to-many:
14
Cardinality Ratio – example (one-to-one)
Name
Sex
Phone
1
Professor
Address
HostelName
1
RollNo Student ResidesIn
1
RoomNo
Hostel
Room
Teaches
CourseID Name
Credits
1
Course
Name
Address
15
Cardinality Ratio – example (many-to-one/one-to-many)
Name
Sex
Phone
N
Professor
Address
Name
1
Sex Professor guides
N
Student
belongsTo
Name
1
Location
Department
(many-to-one)
RoomNo
Name Phone
Address Address (one-to-many)
16
Cardinality Ratio – example (many-to-many)
Name RollNo
Name
CourseId
Student
M
Address
enrolls
N
Credits
Course
Name Phone
worksFor
M N
Name Sponser
Sex Professor SponsoredProject
Address
Value
Start
Date
Duration
End
Date
17
Participation Constraints
• An entity set may participate in a relation either totally or
partially.
• Total participation: Every entity in the set is involved in
some association (or tuple) of the relationship.
• Partial participation: Not all entities in the set are involved
in association (or tuples) of the relationship.
Notation:
E1
total
R
partial
E2
18
Example of total/partial Participation
Name
Sex
Phone
N
Professor
Address
Name
1
Sex Professor guides
N
Student
belongsTo
Name
1
Location
Department
(many-to-one)
RoomNo
Name Phone
Address Address
one-to-many
19
Structural Constraints
• Cardinality Ratio and Participation Constraints are together
called Structural Constraints.
• They are called constraints as the data must satisfy them to be
consistent with the requirements.
• Min-Max notation: pair of numbers (m,n) placed on the line
connecting an entity to the relationship.
• m: the minimum number of times a particular entity must
appear in the relationship tuples at any point of time
• 0 – partial participation
• ≥ 1 – total participation
• n: similarly, the maximum number of times a particular entity
can appear in the relationship tuples at any point of time
20
Comparing the Notations
E1
N
R
1
E2
is equivalent to
(1,1)
R
(0,N)
E1 E2
21
Attributes for Relationship Types
Relationship types can also have attributes.
properties of the association of entities.
M
Student enrolls
N
Course
Grade
grade gives the letter grade (S,A,B, etc.) earned by
the student for a course.
neither an attribute of student nor that of course.
22
Attributes for Relationship Types – More Examples
N
Professor belongsTo
1
Department
joinDate
M N
Professor worksFor SponsoredProject
percentTime
23
Recursive Relationships and Role Names
• Recursive relationship: An entity set relating to itself
gives rise to a recursive relationship
• E.g., the relationship prereqOf is an example of a recursive
relationship on the entity Course
• Role Names – used to specify the exact role in which the
entity participates in the relationships
• Essential in case of recursive relationships
• Can be optionally specified in non-recursive cases
prerequisite
Course
course
Role Names
24
prereq
Of
Weak Entity Sets
Weak Entity Set: An entity set whose members owe their
existence to some entity in a strong entity set.
entities are not of independent existence.
each weak entity is associated with some entity of the
owner entity set through a special relationship.
weak entity set may not have a key attribute.
Double wall
boxS
Owner entity
R W
Always total
Identifying relationship
25
Weak Entity Sets - Example
Year
Name
SectionNo
SemesterNo
CourseID Course
Credits
has
Section
Section
Professor
RoomNo
ClassTime
A popular course may have
several sections each taught
by a different professor and
having its own class room
and meeting times
Partial key:
Uniquely identifies a section
among the set of sections
of a particular course
26
Complete Example for E/R schema: Specifications (1/2)
In an educational institute, there are several departments and
students belong to one of them. Each department has a unique
department number, a name, a location, phone number and is
headed by a professor. Professors have a unique employee Id,
name, phone number.
We like to keep track of the following details regarding students:
name, unique roll number, sex, phone number, date of birth,
age and one or more email addresses. Students have a local
address consisting of the hostel name and the room number.
They also have home address consisting of house number,
street, city and PIN. It is assumed that all students reside in the
hostels.
27
Complete Example for E/R schema: Specifications (2/2)
A course taught in a semester of the year is called a section. There
can be several sections of the same course in a semester; these
are identified by the section number. Each section is taught by a
different professor and has its own timings and a room to meet.
Students enroll for several sections in a semester.
Each course has a name, number of credits and the department that
offers it. A course may have other courses as pre-requisites i.e,
courses to be completed before it can be enrolled in.
Professors also undertake research projects. These are sponsored
by funding agencies and have a specific start date, end date and
amount of money given. More than one professor can be
involved in a project. Also a professor may be simultaneously
working on several projects. A project has a unique projectId.
28
Entities - Student
HNo
EmailId
Street
City
HostelName
PIN
Address
RollNo
local
Address
RoomNo
Name Student
Age
DateOfBirth
Sex
29
Entities – Department and Course
Location
Name
Phone
Credits
CourseID Name
HOD
Department
DeptNo
Course
30
Entities – Professor, Project and Sections
Professor
Name
ProfID
PhoneNumber
StartDate EndDate
Project Sponsor
Amount
ProjectId
Section
Timing
SectionID ClassRoom
31
E/R Diagram showing relationships
N
Student
M
belongs
To
1
Department
1
1
enrolls
N
N
1
sfer
of
1
works
For
N
Course
M
hasSection
prerequisite
Of
N
N
Professor
M
teaches
works
On
NN
Section Project
32
Design Choices: Attribute versus Relationship
• Should offering department be an attribute of a course or
should we create a relationship between Course and Dept
entities called, say, offers ?
• Later approach is preferable when the necessary entity,
in this case the Department, already exists.
• Should class room be an attribute of Section or
should we create an entity called ClassRoom and
have a relationship, say, meetsIn,
connecting Section and ClassRoom?
• In this case, the option of making classRoom as an attribute
of Section is better as we do not want to give a lot of
importance to class room and make it a an entity.
33
Design Choices:
Weak entity versus composite multi-valued attributes
• Note that section could be a composite multi-valued attribute
of Course entity.
• However, if so, section can not participate in relationships,
such as, enrolls with Student entity.
• In general, if a thing, even though not of independent existence,
participates in other relationships on its own, it is best
captured as a weak entity.
• If the above is not the case, composite multi-valued
attribute may be enough.
34
Ternary Relationships
Relationship instance (c, p, j) indicates that
company c supplies a component p that is made use of by the project j
canSupply
Company supply Component
ser
ve
s
s es
u
Project
35
Ternary Relationships
(c,p) in canSupply, (j,p) in uses, (c,j) in serves may not together imply (c,p,j) is
in supply. Whereas the other way round is of course true.
canSupply
Company supply Component
ser
ve
s
s es
u
Project
The binary
relationships
together do not
convey the
same meaning
as supply
36

More Related Content

What's hot

Univ
UnivUniv
Unit iv dbms
Unit   iv dbmsUnit   iv dbms
Unit iv dbms
Arnav Chowdhury
 
Er diagram
Er diagramEr diagram
Er diagram
Sabana Maharjan
 
Example for ER diagram part11
Example for ER diagram part11Example for ER diagram part11
Example for ER diagram part11
DrMohammed Qassim
 
10287 lecture5(2)
10287 lecture5(2)10287 lecture5(2)
The Experience Of Under Graduate Students with Literal Symbols
The Experience Of Under Graduate Students with Literal SymbolsThe Experience Of Under Graduate Students with Literal Symbols
The Experience Of Under Graduate Students with Literal Symbols
iosrjce
 
Entity relationship modelling
Entity relationship modellingEntity relationship modelling
Entity relationship modelling
Dr. C.V. Suresh Babu
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
Bhandari Nawaraj
 
E-R diagram in Database
E-R diagram in DatabaseE-R diagram in Database
E-R diagram in Database
Fatiha Qureshi
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
Rakhi Mukherji
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
Akanksha Jaiswal
 
Data model and entity relationship
Data model and entity relationshipData model and entity relationship
Data model and entity relationship
Knowledge Center Computer
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
Kabindra Koirala
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
sadique_ghitm
 
Introduction er & eer
Introduction er &  eerIntroduction er &  eer
Introduction er & eer
saurabhshertukde
 
Introduction er & eer
Introduction er & eerIntroduction er & eer
Introduction er & eer
saurabhshertukde
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
yash patel
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
Shakila Mahjabin
 
database normalization case study
database normalization case studydatabase normalization case study
database normalization case study
i i
 
ER MODEL
ER MODELER MODEL
ER MODEL
Rupali Rana
 

What's hot (20)

Univ
UnivUniv
Univ
 
Unit iv dbms
Unit   iv dbmsUnit   iv dbms
Unit iv dbms
 
Er diagram
Er diagramEr diagram
Er diagram
 
Example for ER diagram part11
Example for ER diagram part11Example for ER diagram part11
Example for ER diagram part11
 
10287 lecture5(2)
10287 lecture5(2)10287 lecture5(2)
10287 lecture5(2)
 
The Experience Of Under Graduate Students with Literal Symbols
The Experience Of Under Graduate Students with Literal SymbolsThe Experience Of Under Graduate Students with Literal Symbols
The Experience Of Under Graduate Students with Literal Symbols
 
Entity relationship modelling
Entity relationship modellingEntity relationship modelling
Entity relationship modelling
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
 
E-R diagram in Database
E-R diagram in DatabaseE-R diagram in Database
E-R diagram in Database
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
 
Data model and entity relationship
Data model and entity relationshipData model and entity relationship
Data model and entity relationship
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
Introduction er & eer
Introduction er &  eerIntroduction er &  eer
Introduction er & eer
 
Introduction er & eer
Introduction er & eerIntroduction er & eer
Introduction er & eer
 
The entity relationship model
The entity relationship modelThe entity relationship model
The entity relationship model
 
Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
database normalization case study
database normalization case studydatabase normalization case study
database normalization case study
 
ER MODEL
ER MODELER MODEL
ER MODEL
 

Similar to Unit i b(er model)

ERModel1.pdf
ERModel1.pdfERModel1.pdf
ERModel1.pdf
MirHazarKhan1
 
UNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATION
UNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATIONUNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATION
UNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATION
Bhakti Pawar
 
2 entity relationship_model
2 entity relationship_model2 entity relationship_model
2 entity relationship_model
Utkarsh De
 
5e7ry754.pptx
5e7ry754.pptx5e7ry754.pptx
5e7ry754.pptx
qwert001
 
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
 
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
BUSHRASHAIKH804312
 
ER diagram powerpoint
ER diagram powerpointER diagram powerpoint
ER diagram powerpoint
Steffi Libarios
 
ERD(2).ppt
ERD(2).pptERD(2).ppt
ERD(2).ppt
Vijaykumar311275
 
Db lec 02_new
Db lec 02_newDb lec 02_new
Db lec 02_new
Ramadan Babers, PhD
 
Day 1 SQL.pptx
Day 1 SQL.pptxDay 1 SQL.pptx
Day 1 SQL.pptx
raghuKatagall1
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
raghuKatagall1
 
erdiagramspresentation-150826044953-lva1-app6891.pdf
erdiagramspresentation-150826044953-lva1-app6891.pdferdiagramspresentation-150826044953-lva1-app6891.pdf
erdiagramspresentation-150826044953-lva1-app6891.pdf
vinayakjadhav94
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
Akanksha Jaiswal
 
Data modeling
Data modelingData modeling
Data modeling
Tala Alnaber
 
entity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptentity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.ppt
IRWANBINISMAILKPMGur1
 
ER Diagram- Cardinality.pptx
ER Diagram- Cardinality.pptxER Diagram- Cardinality.pptx
ER Diagram- Cardinality.pptx
SCIENTIFICEARTH
 
er-models.pptx
er-models.pptxer-models.pptx
er-models.pptx
UmmerFarooq24
 
Database Design and Entity relationship Model.pptx
Database Design and Entity relationship Model.pptxDatabase Design and Entity relationship Model.pptx
Database Design and Entity relationship Model.pptx
yamuna67903
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
Rubal Sagwal
 
3_Relational_Model.pdf
3_Relational_Model.pdf3_Relational_Model.pdf
3_Relational_Model.pdf
SrikanthS494888
 

Similar to Unit i b(er model) (20)

ERModel1.pdf
ERModel1.pdfERModel1.pdf
ERModel1.pdf
 
UNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATION
UNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATIONUNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATION
UNIT 1 INTRODUCTION TO DBMS, ER DIAGRAM, RELATION
 
2 entity relationship_model
2 entity relationship_model2 entity relationship_model
2 entity relationship_model
 
5e7ry754.pptx
5e7ry754.pptx5e7ry754.pptx
5e7ry754.pptx
 
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
 
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
3-db-er_3-db-er_3-db-er_3-db-er_3-db-er.pptx
 
ER diagram powerpoint
ER diagram powerpointER diagram powerpoint
ER diagram powerpoint
 
ERD(2).ppt
ERD(2).pptERD(2).ppt
ERD(2).ppt
 
Db lec 02_new
Db lec 02_newDb lec 02_new
Db lec 02_new
 
Day 1 SQL.pptx
Day 1 SQL.pptxDay 1 SQL.pptx
Day 1 SQL.pptx
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
 
erdiagramspresentation-150826044953-lva1-app6891.pdf
erdiagramspresentation-150826044953-lva1-app6891.pdferdiagramspresentation-150826044953-lva1-app6891.pdf
erdiagramspresentation-150826044953-lva1-app6891.pdf
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
 
Data modeling
Data modelingData modeling
Data modeling
 
entity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptentity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.ppt
 
ER Diagram- Cardinality.pptx
ER Diagram- Cardinality.pptxER Diagram- Cardinality.pptx
ER Diagram- Cardinality.pptx
 
er-models.pptx
er-models.pptxer-models.pptx
er-models.pptx
 
Database Design and Entity relationship Model.pptx
Database Design and Entity relationship Model.pptxDatabase Design and Entity relationship Model.pptx
Database Design and Entity relationship Model.pptx
 
ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
3_Relational_Model.pdf
3_Relational_Model.pdf3_Relational_Model.pdf
3_Relational_Model.pdf
 

Recently uploaded

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
EverAndrsGuerraGuerr
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
adhitya5119
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
tarandeep35
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
heathfieldcps1
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
Jean Carlos Nunes Paixão
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
Celine George
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
Ashokrao Mane college of Pharmacy Peth-Vadgaon
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
Levi Shapiro
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
NelTorrente
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
Celine George
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
TechSoup
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
chanes7
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
Peter Windle
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
adhitya5119
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
Nicholas Montgomery
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
History of Stoke Newington
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
Priyankaranawat4
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
Priyankaranawat4
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
eBook.com.bd (প্রয়োজনীয় বাংলা বই)
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
TechSoup
 

Recently uploaded (20)

Thesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.pptThesis Statement for students diagnonsed withADHD.ppt
Thesis Statement for students diagnonsed withADHD.ppt
 
Main Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docxMain Java[All of the Base Concepts}.docx
Main Java[All of the Base Concepts}.docx
 
S1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptxS1-Introduction-Biopesticides in ICM.pptx
S1-Introduction-Biopesticides in ICM.pptx
 
The basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptxThe basics of sentences session 5pptx.pptx
The basics of sentences session 5pptx.pptx
 
Lapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdfLapbook sobre os Regimes Totalitários.pdf
Lapbook sobre os Regimes Totalitários.pdf
 
How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17How to Fix the Import Error in the Odoo 17
How to Fix the Import Error in the Odoo 17
 
Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.Biological Screening of Herbal Drugs in detailed.
Biological Screening of Herbal Drugs in detailed.
 
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
June 3, 2024 Anti-Semitism Letter Sent to MIT President Kornbluth and MIT Cor...
 
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...
 
How to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold MethodHow to Build a Module in Odoo 17 Using the Scaffold Method
How to Build a Module in Odoo 17 Using the Scaffold Method
 
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat  Leveraging AI for Diversity, Equity, and InclusionExecutive Directors Chat  Leveraging AI for Diversity, Equity, and Inclusion
Executive Directors Chat Leveraging AI for Diversity, Equity, and Inclusion
 
Digital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments UnitDigital Artifact 1 - 10VCD Environments Unit
Digital Artifact 1 - 10VCD Environments Unit
 
A Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in EducationA Strategic Approach: GenAI in Education
A Strategic Approach: GenAI in Education
 
Advanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docxAdvanced Java[Extra Concepts, Not Difficult].docx
Advanced Java[Extra Concepts, Not Difficult].docx
 
writing about opinions about Australia the movie
writing about opinions about Australia the moviewriting about opinions about Australia the movie
writing about opinions about Australia the movie
 
The History of Stoke Newington Street Names
The History of Stoke Newington Street NamesThe History of Stoke Newington Street Names
The History of Stoke Newington Street Names
 
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdfANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
ANATOMY AND BIOMECHANICS OF HIP JOINT.pdf
 
clinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdfclinical examination of hip joint (1).pdf
clinical examination of hip joint (1).pdf
 
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdfবাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
বাংলাদেশ অর্থনৈতিক সমীক্ষা (Economic Review) ২০২৪ UJS App.pdf
 
Introduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp NetworkIntroduction to AI for Nonprofits with Tapp Network
Introduction to AI for Nonprofits with Tapp Network
 

Unit i b(er model)

  • 2. Entity-Relationship (E/R) Model Widely used conceptual level data model • proposed by Peter P Chen in 1970s Data model to describe the database system at the requirements collection stage • high level description. • easy to understand for the enterprise managers. • rigorous enough to be used for system building. Concepts available in the model • entities and attributes of entities. • relationships between entities. • diagrammatic notation. 2
  • 3. Entities Entity - a thing (animate or inanimate) of independent physical or conceptual existence and distinguishable. In the University database context, an individual student, faculty member, a class room, a course are entities. Entity Set or Entity Type- Collection of entities all having the same properties. Student entity set – collection of all student entities. Course entity set – collection of all course entities. 3
  • 4. Attributes Each entity is described by a set of attributes/properties. student entity StudName – name of the student. RollNumber – the roll number of the student. Sex – the gender of the student etc. All entities in an Entity set/type have the same set of attributes. Chosen set of attributes – amount of detail in modeling. 4
  • 5. Types of Attributes (1/2) • Simple Attributes having atomic or indivisible values. example: Dept – a string PhoneNumber – an eight digit number • Composite Attributes having several components in the value. example: Qualification with components (DegreeName, Year, UniversityName) • Derived Attributes Attribute value is dependent on some other attribute. example: Age depends on DateOf Birth. So age is a derived attribute. 5
  • 6. Types of Attributes (2/2) • Single-valued having only one value rather than a set of values. for instance, PlaceOfBirth – single string value. • Multi-valued having a set of values rather than a single value. for instance, CoursesEnrolled attribute for student EmailAddress attribute for student PreviousDegree attribute for student. • Attributes can be: simple single-valued, simple multi-valued, composite single-valued or composite multi-valued. 6
  • 7. Diagrammatic Notation for Entities entity - rectangle attribute - ellipse connected to rectangle multi-valued attribute - double ellipse composite attribute - ellipse connected to ellipse derived attribute - dashed ellipse Lname Fname Mname Program RollNumber StudName Student Sex Age DateOfBirth AdmissionYear EmailAddress 7
  • 8. Domains of Attributes Each attribute takes values from a set called its domain For instance, studentAge – {17,18, …, 55} HomeAddress – character strings of length 35 Domain of composite attributes – cross product of domains of component attributes Domain of multi-valued attributes – set of subsets of values from the basic domain 8
  • 9. Entity Sets and Key Attributes • Key – an attribute or a collection of attributes whose value(s) uniquely identify an entity in the entity set. • For instance, • RollNumber - Key for Student entity set • EmpID - Key for Faculty entity set • HostelName, RoomNo - Key for Student entity set (assuming that each student gets to stay in a single room) • A key for an entity set may have more than one attribute. • An entity set may have more than one key. • Keys can be determined only from the meaning of the attributes in the entity type. • Determined by the designers 9
  • 10. Relationships • When two or more entities are associated with each other, we have an instance of a Relationship. • E.g.: student Ramesh enrolls in Discrete Mathematics course • Relationship enrolls has Student and Course as the participating entity sets. • Formally, enrolls ⊆ Student × Course • (s,c) ∈ enrolls ⇔ Student ‘s’ has enrolled in Course ‘c’ • Tuples in enrolls – relationship instances • enrolls is called a relationship Type/Set. 10
  • 11. Degree of a relationship • Degree : the number of participating entities. • Degree 2: binary • Degree 3: ternary • Degree n: n-ary • Binary relationships are very common and widely used. 11
  • 12. Diagrammatic Notation for Relationships Relationship – diamond shaped box Rectangle of each participating entity is connected by a line to this diamond. Name of the relationship is written in the box. A R B C 12
  • 13. Binary Relationships and Cardinality Ratio M E1 R N E2 • The number of entities from E2 that an entity from E1 can possibly be associated thru R (and vice-versa) determines the cardinality ratio of R. • Four possibilities are usually specified: • one-to-one (1:1) • one-to-many (1:N) • many-to-one (N:1) • many-to-many (M:N) 13
  • 14. Cardinality Ratios • One-to-one: An E1 entity may be associated with at most one E2 entity and similarly an E2 entity may be associated with at most one E1 entity. An E1 entity may be associated with many E2 entities whereas an E2 entity may be associated with at most one E1 entity. … ( similar to above) Many E1 entities may be associated with a single E2 entity and a single E1 entity may be associated with many E2 entities. • One-to-many: • Many-to-one: • Many-to-many: 14
  • 15. Cardinality Ratio – example (one-to-one) Name Sex Phone 1 Professor Address HostelName 1 RollNo Student ResidesIn 1 RoomNo Hostel Room Teaches CourseID Name Credits 1 Course Name Address 15
  • 16. Cardinality Ratio – example (many-to-one/one-to-many) Name Sex Phone N Professor Address Name 1 Sex Professor guides N Student belongsTo Name 1 Location Department (many-to-one) RoomNo Name Phone Address Address (one-to-many) 16
  • 17. Cardinality Ratio – example (many-to-many) Name RollNo Name CourseId Student M Address enrolls N Credits Course Name Phone worksFor M N Name Sponser Sex Professor SponsoredProject Address Value Start Date Duration End Date 17
  • 18. Participation Constraints • An entity set may participate in a relation either totally or partially. • Total participation: Every entity in the set is involved in some association (or tuple) of the relationship. • Partial participation: Not all entities in the set are involved in association (or tuples) of the relationship. Notation: E1 total R partial E2 18
  • 19. Example of total/partial Participation Name Sex Phone N Professor Address Name 1 Sex Professor guides N Student belongsTo Name 1 Location Department (many-to-one) RoomNo Name Phone Address Address one-to-many 19
  • 20. Structural Constraints • Cardinality Ratio and Participation Constraints are together called Structural Constraints. • They are called constraints as the data must satisfy them to be consistent with the requirements. • Min-Max notation: pair of numbers (m,n) placed on the line connecting an entity to the relationship. • m: the minimum number of times a particular entity must appear in the relationship tuples at any point of time • 0 – partial participation • ≥ 1 – total participation • n: similarly, the maximum number of times a particular entity can appear in the relationship tuples at any point of time 20
  • 21. Comparing the Notations E1 N R 1 E2 is equivalent to (1,1) R (0,N) E1 E2 21
  • 22. Attributes for Relationship Types Relationship types can also have attributes. properties of the association of entities. M Student enrolls N Course Grade grade gives the letter grade (S,A,B, etc.) earned by the student for a course. neither an attribute of student nor that of course. 22
  • 23. Attributes for Relationship Types – More Examples N Professor belongsTo 1 Department joinDate M N Professor worksFor SponsoredProject percentTime 23
  • 24. Recursive Relationships and Role Names • Recursive relationship: An entity set relating to itself gives rise to a recursive relationship • E.g., the relationship prereqOf is an example of a recursive relationship on the entity Course • Role Names – used to specify the exact role in which the entity participates in the relationships • Essential in case of recursive relationships • Can be optionally specified in non-recursive cases prerequisite Course course Role Names 24 prereq Of
  • 25. Weak Entity Sets Weak Entity Set: An entity set whose members owe their existence to some entity in a strong entity set. entities are not of independent existence. each weak entity is associated with some entity of the owner entity set through a special relationship. weak entity set may not have a key attribute. Double wall boxS Owner entity R W Always total Identifying relationship 25
  • 26. Weak Entity Sets - Example Year Name SectionNo SemesterNo CourseID Course Credits has Section Section Professor RoomNo ClassTime A popular course may have several sections each taught by a different professor and having its own class room and meeting times Partial key: Uniquely identifies a section among the set of sections of a particular course 26
  • 27. Complete Example for E/R schema: Specifications (1/2) In an educational institute, there are several departments and students belong to one of them. Each department has a unique department number, a name, a location, phone number and is headed by a professor. Professors have a unique employee Id, name, phone number. We like to keep track of the following details regarding students: name, unique roll number, sex, phone number, date of birth, age and one or more email addresses. Students have a local address consisting of the hostel name and the room number. They also have home address consisting of house number, street, city and PIN. It is assumed that all students reside in the hostels. 27
  • 28. Complete Example for E/R schema: Specifications (2/2) A course taught in a semester of the year is called a section. There can be several sections of the same course in a semester; these are identified by the section number. Each section is taught by a different professor and has its own timings and a room to meet. Students enroll for several sections in a semester. Each course has a name, number of credits and the department that offers it. A course may have other courses as pre-requisites i.e, courses to be completed before it can be enrolled in. Professors also undertake research projects. These are sponsored by funding agencies and have a specific start date, end date and amount of money given. More than one professor can be involved in a project. Also a professor may be simultaneously working on several projects. A project has a unique projectId. 28
  • 30. Entities – Department and Course Location Name Phone Credits CourseID Name HOD Department DeptNo Course 30
  • 31. Entities – Professor, Project and Sections Professor Name ProfID PhoneNumber StartDate EndDate Project Sponsor Amount ProjectId Section Timing SectionID ClassRoom 31
  • 32. E/R Diagram showing relationships N Student M belongs To 1 Department 1 1 enrolls N N 1 sfer of 1 works For N Course M hasSection prerequisite Of N N Professor M teaches works On NN Section Project 32
  • 33. Design Choices: Attribute versus Relationship • Should offering department be an attribute of a course or should we create a relationship between Course and Dept entities called, say, offers ? • Later approach is preferable when the necessary entity, in this case the Department, already exists. • Should class room be an attribute of Section or should we create an entity called ClassRoom and have a relationship, say, meetsIn, connecting Section and ClassRoom? • In this case, the option of making classRoom as an attribute of Section is better as we do not want to give a lot of importance to class room and make it a an entity. 33
  • 34. Design Choices: Weak entity versus composite multi-valued attributes • Note that section could be a composite multi-valued attribute of Course entity. • However, if so, section can not participate in relationships, such as, enrolls with Student entity. • In general, if a thing, even though not of independent existence, participates in other relationships on its own, it is best captured as a weak entity. • If the above is not the case, composite multi-valued attribute may be enough. 34
  • 35. Ternary Relationships Relationship instance (c, p, j) indicates that company c supplies a component p that is made use of by the project j canSupply Company supply Component ser ve s s es u Project 35
  • 36. Ternary Relationships (c,p) in canSupply, (j,p) in uses, (c,j) in serves may not together imply (c,p,j) is in supply. Whereas the other way round is of course true. canSupply Company supply Component ser ve s s es u Project The binary relationships together do not convey the same meaning as supply 36