SlideShare a Scribd company logo
1 of 52
Introduction
 The ER model defines the conceptual view of a
database.
 It works around real-world entities and the
associations among them.
 At view level, the ER model is considered a good
option for designing databases.
Basic Terms
 An entity can be a real-world object, either animate or
inanimate, that can be easily identifiable.
 For example, in a school database, students, teachers,
classes, and courses offered can be considered as
entities.
 All these entities have some attributes or properties
that give them their identity
Basic Terms
 Entities are represented by means of their properties,
called attributes.
 All attributes have values.
 For example, a student entity may have name, class,
and age as attributes.
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 − Composite attributes are made of more than
one simple attribute. For example, a student's complete name may have
first_name and last_name.
 Derived attribute − Derived attributes are the attributes that do not
exist in the physical database, but their values are derived from other
attributes present in the database.
 For 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.
Types of Attributes
 Single-value attribute − Single-value attributes
contain single value.
 For example − Social_Security_Number.
 Multi-value attribute − Multi-value attributes may
contain more than one values.
 For example, a person can have more than one phone
number, email_address, etc.
Basic Terms
 Entity-Set and Keys
 Key is an attribute or collection of attributes that
uniquely identifies an entity among entity set.
 For example, the roll_number of a student makes
him/her identifiable among students.
 Super Key − A set of attributes (one or more) that
collectively identifies an entity in an entity set.
Basic Terms
 Candidate Key − A minimal super key is called a
candidate key. An entity set may have more than one
candidate key.
 Primary Key − A primary key is one of the candidate
keys chosen by the database designer to uniquely
identify the entity set.
Basic Terms
 Relationship
 The association among entities is called a relationship.
 For example, an employee works_ata department, a
student enrolls in a course. Here, Works_at and
Enrolls are called relationships.
Basic Terms
 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.
Basic Terms
 Degree of Relationship
 The number of participating entities in a relationship
defines the degree of the relationship.
 Binary = degree 2
 Ternary = degree 3
 n-ary
Basic Terms
 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.
Basic Terms
Basic Terms
Basic Terms
Basic Terms
ER Representation
ER Representation
ER Representation
ER Representation
ER Representation
ER Representation
ER Representation
ER Representation
ER Representation
Weak and Strong Entity
 A weak entity is an entity that depends on the existence of
another entity. In more technical terms it can defined as an
entity that cannot be identified by its own attributes.
 It uses a foreign key combined with its attributed to form the
primary key.
 An entity like order item is a good example for this.
 The order item will be meaningless without an order so it
depends on the existence of order.
Weak and Strong Entity
Weak and Strong Entity
 An entity set that has a primary key is called as Strong
entity set.
 Consider an entity set Payment which has three
attributes: payment_number, payment_date and
payment_amount.
 Although each payment entity is distinct but payment
for different loans may share the same payment
number. Thus, this entity set does not have a primary
key and it is an entity set
Weak and Strong Entity
 A weak entity set does not have a primary key but we
need a means of distinguishing among all those
entries in the entity set that depend on one particular
strong entity set.
 The discriminator of a weak entity set is a set of
attributes that allows this distinction be made.
 For example, payment_number acts as discriminator
for payment entity set.
Weak and Strong Entity
 A member of a strong entity set is called dominant
entity and member of weak entity set is called as
subordinate entity.
Weak and Strong Entity
Total and Partial Participation
Total and Partial Participation
 Relationships between entities can be optional or
compulsory.
 In our example, we could decide that a person is considered
to be a customer only if they have bought a product.
 On the other hand, we could say that a customer is a person
whom we know about and whom we hope might buy
something—that is, we can have people listed as customers
in our database who never buy a product
Total and Partial Participation
 In the first case, the customer entity has total
participation in the bought relationship (all customers
have bought a product, and we can’t have
a customer who hasn’t bought a product), while in the
second case it has partial participation (a customer can
buy a product).
 These are referred to as the participation constraints of
the relationship.
Total and Partial Participation
 Employee head of department
 Not all employees become a head, but department will
always be headed by one employee.
 So employee participated partially in relationship.
Roles
Example of ER Diagram
 In case of college, a college contain many departments
 Each dept. can offer any number of courses
 Many instructor can work in a dept.
 An instructor can work only in one dept.
 For each dept. there is head
 An instructor can be head of only one dept.
 Each instructor can take any no. of courses
 A course can be taken by only one instructor
 A student can enroll for any no. of courses
 Each course can have any no. of students
Example of ER Diagram
 Step 1 : Identify the Entities
What are the entities here?
 From the statements given, the entities are
 Department
 Course
 Instructor
 Student
Example of ER Diagram
 Step 2 : Identify the relationships
 One department offers many courses. But one particular course can be
offered by only one department. hence the cardinality between
department and course is One to Many (1:N)
 One department has multiple instructors . But instructor belongs to
only one department. Hence the cardinality between department and
instructor is One to Many (1:N)
 One department has only one head and one head can be the head of
only one department. Hence the cardinality is one to one. (1:1)
 One course can be enrolled by many students and one student can
enroll for many courses. Hence the cardinality between course and
student is Many to Many (M:N)
 One course is taught by only one instructor. But one instructor teaches
many courses. Hence the cardinality between course and instructor is
Many to One (N :1)
Example of ER Diagram
 Step 3: Identify the key attributes
 "Departmen_Name" can identify a department
uniquely. Hence Department_Name is the key
attribute for the Entity "Department".
 Course_ID is the key attribute for "Course" Entity.
 Student_ID is the key attribute for "Student" Entity.
 Instructor_ID is the key attribute for "Instructor"
Entity.
Example of ER Diagram
 Step 4: Identify other relevant attributes
 For the department entity, other attributes are location
 For course entity, other attributes are
course_name,duration
 For instructor entity, other attributes are first_name,
last_name, phone
 For student entity, first_name, last_name, phone
Example of ER Diagram
Generalization
Example
Specialization
Specialization
Aggregation
 Aggregation is a process when relation between two
entity is treated as a single entity.
 Here the relation between Center and Course, is acting
as an Entity in relation with Visitor.
Aggregation
Aggregation
 The E-R model cannot express relationships among
relationships.
 When would we need such a thing?
 Consider a DB with information about employees who
work on a particular project and use a number of
machines doing that work.
Aggregation
Aggregation
 Relationship sets work and uses could be combined into a
single set. However, they shouldn't be, as this would
obscure the logical structure of this scheme.
 The solution is to use aggregation.
 An abstraction through which relationships are treated as
higher-level entities.
 For our example, we treat the relationship set work and the
entity sets employee and project as a higher-level entity
set called work.
Aggregation

More Related Content

What's hot

Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship DiagramShakila Mahjabin
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagramssadique_ghitm
 
Entity (types, attibute types)
Entity (types, attibute types)Entity (types, attibute types)
Entity (types, attibute types)Zaheer Soomro
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelSlideshare
 
Week 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data ModelingWeek 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data Modelingoudesign
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational modelChirag vasava
 
Design issues with constraints of E-R model
Design issues with constraints of E-R modelDesign issues with constraints of E-R model
Design issues with constraints of E-R modelPaurav Shah
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagramTech_MX
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTUREArchie Jamwal
 
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and AggregationDbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and AggregationBIT Durg
 
Mapping cardinalities
Mapping cardinalitiesMapping cardinalities
Mapping cardinalitiesArafat Hossan
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESVENNILAV6
 

What's hot (20)

Entity Relationship Diagram
Entity Relationship DiagramEntity Relationship Diagram
Entity Relationship Diagram
 
Er diagrams presentation
Er diagrams presentationEr diagrams presentation
Er diagrams presentation
 
Entity Relationship Diagrams
Entity Relationship DiagramsEntity Relationship Diagrams
Entity Relationship Diagrams
 
Er model
Er modelEr model
Er model
 
Entity (types, attibute types)
Entity (types, attibute types)Entity (types, attibute types)
Entity (types, attibute types)
 
Er diagram
Er diagramEr diagram
Er diagram
 
EER modeling
EER modelingEER modeling
EER modeling
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Week 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data ModelingWeek 3 Classification of Database Management Systems & Data Modeling
Week 3 Classification of Database Management Systems & Data Modeling
 
Dbms relational model
Dbms relational modelDbms relational model
Dbms relational model
 
Relational model
Relational modelRelational model
Relational model
 
Design issues with constraints of E-R model
Design issues with constraints of E-R modelDesign issues with constraints of E-R model
Design issues with constraints of E-R model
 
DBMS: Types of keys
DBMS:  Types of keysDBMS:  Types of keys
DBMS: Types of keys
 
DBMS Keys
DBMS KeysDBMS Keys
DBMS Keys
 
Schema
SchemaSchema
Schema
 
How to Draw an Effective ER diagram
How to Draw an Effective ER diagramHow to Draw an Effective ER diagram
How to Draw an Effective ER diagram
 
STACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURESTACKS IN DATASTRUCTURE
STACKS IN DATASTRUCTURE
 
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and AggregationDbms Notes Lecture 9 : Specialization, Generalization and Aggregation
Dbms Notes Lecture 9 : Specialization, Generalization and Aggregation
 
Mapping cardinalities
Mapping cardinalitiesMapping cardinalities
Mapping cardinalities
 
STRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIESSTRUCTURE OF SQL QUERIES
STRUCTURE OF SQL QUERIES
 

Similar to Er model (20)

E r model
E r modelE r model
E r model
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptx
 
ER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docxER Diagram_Kameshwari.docx
ER Diagram_Kameshwari.docx
 
DBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptxDBMS Unit-2_Final.pptx
DBMS Unit-2_Final.pptx
 
Entity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptxEntity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptx
 
dbms mannual.pdf
dbms mannual.pdfdbms mannual.pdf
dbms mannual.pdf
 
Er Modeling
Er ModelingEr Modeling
Er Modeling
 
Unit iv dbms
Unit   iv dbmsUnit   iv dbms
Unit iv dbms
 
Data Modeling Er
Data Modeling ErData Modeling Er
Data Modeling Er
 
Entity Relationship Modelling
Entity Relationship ModellingEntity Relationship Modelling
Entity Relationship Modelling
 
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...
 
5e7ry754.pptx
5e7ry754.pptx5e7ry754.pptx
5e7ry754.pptx
 
database
databasedatabase
database
 
Database
DatabaseDatabase
Database
 
Jobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptxJobs manager vs supervisor.pptx
Jobs manager vs supervisor.pptx
 
Er diagrams
Er diagramsEr diagrams
Er diagrams
 
Introduction to database-ER Model
Introduction to database-ER ModelIntroduction to database-ER Model
Introduction to database-ER Model
 
Data modeling using the entity relationship model
Data modeling using the entity relationship modelData modeling using the entity relationship model
Data modeling using the entity relationship model
 
Chapter3
Chapter3Chapter3
Chapter3
 

More from Soumyajit Dutta

More from Soumyajit Dutta (8)

Normalisation
NormalisationNormalisation
Normalisation
 
Concurrency control
Concurrency controlConcurrency control
Concurrency control
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functions
 
Transaction processing
Transaction processingTransaction processing
Transaction processing
 
Single row functions
Single row functionsSingle row functions
Single row functions
 
Chapter 4
Chapter 4Chapter 4
Chapter 4
 
Chapter 2
Chapter 2Chapter 2
Chapter 2
 
Computer Organisation Design
Computer Organisation DesignComputer Organisation Design
Computer Organisation Design
 

Recently uploaded

FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfPondicherry University
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxEsquimalt MFRC
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxJisc
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111GangaMaiya1
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfNirmal Dwivedi
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptxJoelynRubio1
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxheathfieldcps1
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxakanksha16arora
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17Celine George
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17Celine George
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxDr. Ravikiran H M Gowda
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptNishitharanjan Rout
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSCeline George
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxCeline George
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 

Recently uploaded (20)

FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptxHMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
HMCS Max Bernays Pre-Deployment Brief (May 2024).pptx
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111Details on CBSE Compartment Exam.pptx1111
Details on CBSE Compartment Exam.pptx1111
 
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdfUGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
UGC NET Paper 1 Unit 7 DATA INTERPRETATION.pdf
 
21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx21st_Century_Skills_Framework_Final_Presentation_2.pptx
21st_Century_Skills_Framework_Final_Presentation_2.pptx
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
The basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptxThe basics of sentences session 3pptx.pptx
The basics of sentences session 3pptx.pptx
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...OS-operating systems- ch05 (CPU Scheduling) ...
OS-operating systems- ch05 (CPU Scheduling) ...
 
How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17How to Add a Tool Tip to a Field in Odoo 17
How to Add a Tool Tip to a Field in Odoo 17
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
AIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.pptAIM of Education-Teachers Training-2024.ppt
AIM of Education-Teachers Training-2024.ppt
 
How to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POSHow to Manage Global Discount in Odoo 17 POS
How to Manage Global Discount in Odoo 17 POS
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
What is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptxWhat is 3 Way Matching Process in Odoo 17.pptx
What is 3 Way Matching Process in Odoo 17.pptx
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 

Er model

  • 1.
  • 2. Introduction  The ER model defines the conceptual view of a database.  It works around real-world entities and the associations among them.  At view level, the ER model is considered a good option for designing databases.
  • 3. Basic Terms  An entity can be a real-world object, either animate or inanimate, that can be easily identifiable.  For example, in a school database, students, teachers, classes, and courses offered can be considered as entities.  All these entities have some attributes or properties that give them their identity
  • 4. Basic Terms  Entities are represented by means of their properties, called attributes.  All attributes have values.  For example, a student entity may have name, class, and age as attributes.
  • 5. 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 − Composite attributes are made of more than one simple attribute. For example, a student's complete name may have first_name and last_name.  Derived attribute − Derived attributes are the attributes that do not exist in the physical database, but their values are derived from other attributes present in the database.  For 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.
  • 6. Types of Attributes  Single-value attribute − Single-value attributes contain single value.  For example − Social_Security_Number.  Multi-value attribute − Multi-value attributes may contain more than one values.  For example, a person can have more than one phone number, email_address, etc.
  • 7. Basic Terms  Entity-Set and Keys  Key is an attribute or collection of attributes that uniquely identifies an entity among entity set.  For example, the roll_number of a student makes him/her identifiable among students.  Super Key − A set of attributes (one or more) that collectively identifies an entity in an entity set.
  • 8. Basic Terms  Candidate Key − A minimal super key is called a candidate key. An entity set may have more than one candidate key.  Primary Key − A primary key is one of the candidate keys chosen by the database designer to uniquely identify the entity set.
  • 9. Basic Terms  Relationship  The association among entities is called a relationship.  For example, an employee works_ata department, a student enrolls in a course. Here, Works_at and Enrolls are called relationships.
  • 10. Basic Terms  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.
  • 11. Basic Terms  Degree of Relationship  The number of participating entities in a relationship defines the degree of the relationship.  Binary = degree 2  Ternary = degree 3  n-ary
  • 12. Basic Terms  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.
  • 26. Weak and Strong Entity  A weak entity is an entity that depends on the existence of another entity. In more technical terms it can defined as an entity that cannot be identified by its own attributes.  It uses a foreign key combined with its attributed to form the primary key.  An entity like order item is a good example for this.  The order item will be meaningless without an order so it depends on the existence of order.
  • 27. Weak and Strong Entity
  • 28. Weak and Strong Entity  An entity set that has a primary key is called as Strong entity set.  Consider an entity set Payment which has three attributes: payment_number, payment_date and payment_amount.  Although each payment entity is distinct but payment for different loans may share the same payment number. Thus, this entity set does not have a primary key and it is an entity set
  • 29. Weak and Strong Entity  A weak entity set does not have a primary key but we need a means of distinguishing among all those entries in the entity set that depend on one particular strong entity set.  The discriminator of a weak entity set is a set of attributes that allows this distinction be made.  For example, payment_number acts as discriminator for payment entity set.
  • 30. Weak and Strong Entity  A member of a strong entity set is called dominant entity and member of weak entity set is called as subordinate entity.
  • 31. Weak and Strong Entity
  • 32. Total and Partial Participation
  • 33. Total and Partial Participation  Relationships between entities can be optional or compulsory.  In our example, we could decide that a person is considered to be a customer only if they have bought a product.  On the other hand, we could say that a customer is a person whom we know about and whom we hope might buy something—that is, we can have people listed as customers in our database who never buy a product
  • 34. Total and Partial Participation  In the first case, the customer entity has total participation in the bought relationship (all customers have bought a product, and we can’t have a customer who hasn’t bought a product), while in the second case it has partial participation (a customer can buy a product).  These are referred to as the participation constraints of the relationship.
  • 35. Total and Partial Participation  Employee head of department  Not all employees become a head, but department will always be headed by one employee.  So employee participated partially in relationship.
  • 36. Roles
  • 37. Example of ER Diagram  In case of college, a college contain many departments  Each dept. can offer any number of courses  Many instructor can work in a dept.  An instructor can work only in one dept.  For each dept. there is head  An instructor can be head of only one dept.  Each instructor can take any no. of courses  A course can be taken by only one instructor  A student can enroll for any no. of courses  Each course can have any no. of students
  • 38. Example of ER Diagram  Step 1 : Identify the Entities What are the entities here?  From the statements given, the entities are  Department  Course  Instructor  Student
  • 39. Example of ER Diagram  Step 2 : Identify the relationships  One department offers many courses. But one particular course can be offered by only one department. hence the cardinality between department and course is One to Many (1:N)  One department has multiple instructors . But instructor belongs to only one department. Hence the cardinality between department and instructor is One to Many (1:N)  One department has only one head and one head can be the head of only one department. Hence the cardinality is one to one. (1:1)  One course can be enrolled by many students and one student can enroll for many courses. Hence the cardinality between course and student is Many to Many (M:N)  One course is taught by only one instructor. But one instructor teaches many courses. Hence the cardinality between course and instructor is Many to One (N :1)
  • 40. Example of ER Diagram  Step 3: Identify the key attributes  "Departmen_Name" can identify a department uniquely. Hence Department_Name is the key attribute for the Entity "Department".  Course_ID is the key attribute for "Course" Entity.  Student_ID is the key attribute for "Student" Entity.  Instructor_ID is the key attribute for "Instructor" Entity.
  • 41. Example of ER Diagram  Step 4: Identify other relevant attributes  For the department entity, other attributes are location  For course entity, other attributes are course_name,duration  For instructor entity, other attributes are first_name, last_name, phone  For student entity, first_name, last_name, phone
  • 42. Example of ER Diagram
  • 47. Aggregation  Aggregation is a process when relation between two entity is treated as a single entity.  Here the relation between Center and Course, is acting as an Entity in relation with Visitor.
  • 49. Aggregation  The E-R model cannot express relationships among relationships.  When would we need such a thing?  Consider a DB with information about employees who work on a particular project and use a number of machines doing that work.
  • 51. Aggregation  Relationship sets work and uses could be combined into a single set. However, they shouldn't be, as this would obscure the logical structure of this scheme.  The solution is to use aggregation.  An abstraction through which relationships are treated as higher-level entities.  For our example, we treat the relationship set work and the entity sets employee and project as a higher-level entity set called work.