SlideShare a Scribd company logo
1
Entity Relationship Modeling
Objectives:
• To illustrate how relationships between entities are defined and refined.
• To know how relationships are incorporated into the database design
process.
• To describe how ERD components affect database design and
implementation.
2
Entity-Relationship (ER) Modeling.
• Entity Relationship (ER) Diagram
– A detailed, logical representation of the entities,
associations and data elements for an organization or
business
• Notation uses three main constructs
– Data entities
– Relationships
– Attributes Chen Model &
Crow’s Foot
Model
Person, place, object, event
or concept about which data
is to be maintained
named property or
characteristic of an
entity
Association
between the
instances of one or
more entity types
Represents a set or collection of
objects in the real world that
share the same properties
Chen Notation
EntityName Verb Phrase AttributeName
Crow’s Foot Notation
EntityName
Entity Attribute
EntityName
List of
Attributes
Relationship
Verb phrase
5
2.1 Entities
• Examples of entities:
– Person: EMPLOYEE, STUDENT, PATIENT
– Place: STORE, WAREHOUSE
– Object: MACHINE, PRODUCT, CAR
– Event: SALE,REGISTRATION, RENEWAL
– Concept: ACCOUNT, COURSE
• Guidelines for naming and defining entity types:
– An entity type should be descriptive and specific
– An entity name should be concise
– Event entity types should be named for the result of the event, not
the activity or process of the event.
6
2.2 Attributes
• Example of entity types and associated attributes:
STUDENT: Student_ID, Student_Name, Home_Address,
Phone_Number, Major
• Guidelines for naming attributes:
– An attribute name is a noun.
– An attribute name should be unique
– To make an attribute name unique and clear, each attribute name
should follow a standard format
– Similar attributes of different entity types should use similar but
distinguishing names.
7
Example
Staff
StaffID
Name Gender
IC
Staff
StaffID
Name
Gender
IC
PK
8
2.3 Relationships
 Associations between instances of one or more entity types that is of interest
 Given a name that describes its function.
• relationship name is an active or a passive verb.
Author Book
Relationship name:
writes
An author writes one or more books
A book can be written by one or more authors.
9
2.3.1 Degree of Relationships
• Degree: number of entity types that participate in a relationship
• Three cases
– Unary: between two instances of one entity type
– Binary: between the instances of two entity types
– Ternary: among the instances of three entity types
10
main components and its symbols in
ER Diagrams:
Following are the main components and its symbols in ER Diagrams:
•Rectangles: This Entity Relationship Diagram symbol represents entity types
•Ellipses : Symbol represent attributes
•Diamonds: This symbol represents relationship types
•Lines: It links attributes to entity types and entity types with other relationship types
•Primary key: attributes are underlined
•Double Ellipses: Represent multi-valued attributes
11
Attribute
• An attribute describes the property of an
entity. An attribute is represented as Oval in
an ER diagram. There are four types of
attributes:
• 1. Key attribute
2. Composite attribute
3. Multivalued attribute
4. Derived attribute
12
key attribute
• A key attribute can uniquely identify an entity
from an entity set. For example, student roll
number can uniquely identify a student from a
set of students. Key attribute is represented by
oval same as other attributes however the text
of key attribute is underlined.
13
composite attribute
An attribute that is a combination of other attributes is known as composite
attribute. For example, In student entity, the student address is a composite
attribute as an address is composed of other attributes such as pin code, state,
country.
14
Multivalued attribute:
• An attribute that can hold multiple values is
known as multivalued attribute. It is
represented with double ovals in an ER
Diagram. For example – A person can have
more than one phone numbers so the
phone number attribute is multivalued.
15
4. Derived attribute:
• A derived attribute is one whose value is
dynamic and derived from another attribute.
It is represented by dashed oval in an ER
Diagram. For example – Person age is a
derived attribute as it changes over time
and can be derived from another attribute
(Date of birth).
16
Participation Constraints
• Total Participation − Each entity is involved in the
relationship. Total participation is represented by double
lines.
• Partial participation − Not all entities are involved in the
relationship. Partial participation is represented by single
lines.
17
• A relationship where two entities are
participating is called a binary relationship.
Cardinality is the number of instance of an
entity from a relation that can be associated
with the relation.
18
One-to-one −
• When only one instance of an entity is
associated with the relationship, it is marked
as '1:1'.
19
One-to-many
• One-to-many − When more than one
instance of an entity is associated with a
relationship, it is marked as '1:N'.
20
Many-to-one
• Many-to-one − When more than one
instance of entity is associated with the
relationship, it is marked as 'N:1'.
21
Many-to-many
• Many-to-many − The following image
reflects that more than one instance of an
entity on the left and more than one instance
of an entity on the right can be associated
with the relationship. It depicts many-to-
many relationship.
•
22
2.4 Cardinality and Connectivity
• Relationships can be classified as either
• one – to – one
• one – to – many
• many – to –many
• Cardinality : minimum and maximum number of
instances of Entity B that can (or must be)
associated with each instance of entity A.
Connectivity
23
2.4.1 Connectivity
• Chen Model
– 1 to represent one.
– M to represent many
• Crow’s Foot
many
One
One or many
1
M
Mandatory one , means (1,1)
Optional? – we’ll see after this
24
2.4 Cardinality and Connectivity
Professor Class
teaches
A professor teaches class OR
A class is taught by professor
How Many??
Professor Class
teaches
25
Strong Entity
• Strong Entity is independent to any other
entity in the schema.
• A strong entity always have a primary key. In
ER diagram, a strong entity is represented
by rectangle.
• Relationship between two strong entities is
represented by a diamond.
• A set of strong entities is known as strong
entity set.
26
27
Weak Entity
• Weak entity is dependent on strong entity
and cannot exists without a corresponding
strong.
• It has a foreign key which relates it to a
strong entity. A weak entity is represented by
double rectangle.
• Relationship between a strong entity and a
weak entity is represented by double
diamond. The foreign key is also called a
partial discriminator key.
28
29
Strong Entity Set Weak Entity Set
Strong entity set always has a primary key.
It does not have enough attributes to build a
primary key.
It is represented by a rectangle symbol. It is represented by a double rectangle symbol.
It contains a Primary key represented by the
underline symbol.
It contains a Partial Key which is represented by a
dashed underline symbol.
The member of a strong entity set is called as
dominant entity set.
The member of a weak entity set called as a
subordinate entity set.
Primary Key is one of its attributes which helps to
identify its member.
In a weak entity set, it is a combination of primary
key and partial key of the strong entity set.
In the ER diagram the relationship between two
strong entity set shown by using a diamond
symbol.
The relationship between one strong and a weak
entity set shown by using the double diamond
symbol.
The connecting line of the strong entity set with the
relationship is single.
The line connecting the weak entity set for
identifying relationship is double.
Comparing Strong Entity and weak Entity
30
What are Keys in DBMS?
• KEYS in DBMS is an attribute or set of
attributes which helps you to identify a
row(tuple) in a relation(table).
• They allow you to find the relation between
two tables.
• Key is also helpful for finding unique record
or row from the table. Database key is also
helpful for finding unique record or row from
the table.
31
Employee ID FirstName LastName
11 Andrew Johnson
22 Tom Wood
33 Alex Hale
32
Types of Keys in DBMS (Database
Management System)
33
Example
34
Primary Key
Primary Key: There can be more than one candidate key in relation out of which
one can be chosen as the primary key. For Example, STUD_NO, as well as
STUD_PHONE both, are candidate keys for relation STUDENT but STUD_NO can
be chosen as the primary key (only one out of many candidate keys).
35
Candidate Key:
• The minimal set of attributes that can
uniquely identify a tuple is known as
a candidate key.
• For Example, STUD_NO in STUDENT
relation.
• The candidate key can be simple (having
only one attribute) or composite as well. For
Example, {STUD_NO, COURSE_NO} is a
composite candidate key for relation
36
• Super Key: The set of attributes that can
uniquely identify a tuple is known as Super
Key. For Example, STUD_NO, (STUD_NO,
STUD_NAME), etc.
• Adding zero or more attributes to the
candidate key generates the super key.
• A candidate key is a super key but vice
versa is not true.
37
Alternate Key:
• The candidate key other than the primary
key is called an alternate key.
• For Example, STUD_NO, as well as
STUD_PHONE both, are candidate keys for
relation STUDENT but STUD_PHONE will
be an alternate key (only one out of many
candidate keys).
38
Foreign keys
• Foreign keys are the column of the table
which is used to point to the primary key of
another table.
39
Composite Key
• A composite key is a key that contains two
or more attributes that help to identify a
record in the table uniquely.
• we have to use this combination to identify
the records separately. It is not possible to
use individual attributes to identify the
records.
40
• For example, assume that there is a table to store
the marks of the students.
• It has 4 attributes or columns: student_id,
subject_id, marks and exam_name.
• In this table, we cannot consider either the
student_id or the subject_id as the primary key
because we cannot uniquely identify the records
by using them. However, we can identify each
record by using the combination of student_id and
subject_id. Therefore, this combination is
the primary key. Furthermore, this combination is
also a composite key.
41
Candidate Key vs Composite key
42
Surrogate key
Surrogate key also called a synthetic primary
key, is generated when a new record is
inserted into a table automatically by a
database that can be declared as the primary
key of that table . It is the sequential number
outside of the database that is made available
to the user and the application or it acts as an
object that is present in the database but is
not visible to the user or application.
43
Example
Suppose we have two tables of two different
schools having the same column registration_no
, name and percentage , each table having its
own natural primary key, that is registration_no.
Table A Table B
registration_n
o
name percentage
CS107 Taylor 49
CS108 Simon 86
CS109 Sam 96
CS110 Andy 58
registration_n
o
name percentage
210101 Harry 90
210102 Maxwell 65
210103 Lee 87
210104 Chris 76
44
Now, suppose we want to merge the details of both the schools in a single table
.
Resulting table will be –
45
Application of DBMS
46
Sectorsssss Use of DBMS
Banking For customer information, account activities,
payments, deposits, loans, etc.
Airlines For reservations and schedule information.
Universities For student information, course registrations,
colleges and grades.
Telecommunication It helps to keep call records, monthly bills,
maintaining balances, etc.
Finance For storing information about stock, sales, and
purchases of financial instruments like stocks
and bonds.
Sales Use for storing customer, product & sales
information.
Manufacturing It is used for the management of supply chain
and for tracking production of items. Inventories
status in warehouses.
HR Management For information about employees, salaries,
payroll, deduction, generation of paychecks,
etc.
47
~The END~
Q & A

More Related Content

What's hot

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
Oum Saokosal
 
normalization
normalizationnormalization
normalization
Girija Muscut
 
Relational model
Relational modelRelational model
Relational model
Dabbal Singh Mahara
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
Saranya Natarajan
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization emailharmeet
 
Fundamentals of Data Modeling and Database Design by Dr. Kamal Gulati
Fundamentals of Data Modeling and Database Design by Dr. Kamal GulatiFundamentals of Data Modeling and Database Design by Dr. Kamal Gulati
Fundamentals of Data Modeling and Database Design by Dr. Kamal Gulati
Amity University | FMS - DU | IMT | Stratford University | KKMI International Institute | AIMA | DTU
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
Bhandari Nawaraj
 
Keys in dbms
Keys in dbmsKeys in dbms
Keys in dbms
shalini s
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
Kabindra Koirala
 
RELATIONSHIP IN DBMS.pptx
RELATIONSHIP IN DBMS.pptxRELATIONSHIP IN DBMS.pptx
RELATIONSHIP IN DBMS.pptx
KAnurag2
 
DBMS PPT
DBMS PPTDBMS PPT
DBMS PPT
Prabhu Goyal
 
ER to relational Mapping: Data base design using ER to relational language. C...
ER to relational Mapping: Data base design using ER to relational language. C...ER to relational Mapping: Data base design using ER to relational language. C...
ER to relational Mapping: Data base design using ER to relational language. C...
Raj vardhan
 
Sql server ___________session_17(indexes)
Sql server  ___________session_17(indexes)Sql server  ___________session_17(indexes)
Sql server ___________session_17(indexes)
Ehtisham Ali
 
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Beat Signer
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)tameemyousaf
 
Database Keys & Relationship
Database Keys & RelationshipDatabase Keys & Relationship
Database Keys & Relationship
Bellal Hossain
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
Mudasir Qazi
 
Logical Design and Conceptual Database Design
Logical Design and Conceptual Database DesignLogical Design and Conceptual Database Design
Logical Design and Conceptual Database Design
Er. Nawaraj Bhandari
 
Database Keys
Database KeysDatabase Keys
Database Keys
Forrester High School
 

What's hot (20)

Databases: Normalisation
Databases: NormalisationDatabases: Normalisation
Databases: Normalisation
 
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
 
normalization
normalizationnormalization
normalization
 
Relational model
Relational modelRelational model
Relational model
 
ER-Model-ER Diagram
ER-Model-ER DiagramER-Model-ER Diagram
ER-Model-ER Diagram
 
Lecture 04 normalization
Lecture 04 normalization Lecture 04 normalization
Lecture 04 normalization
 
Fundamentals of Data Modeling and Database Design by Dr. Kamal Gulati
Fundamentals of Data Modeling and Database Design by Dr. Kamal GulatiFundamentals of Data Modeling and Database Design by Dr. Kamal Gulati
Fundamentals of Data Modeling and Database Design by Dr. Kamal Gulati
 
The Relational Model
The Relational ModelThe Relational Model
The Relational Model
 
Keys in dbms
Keys in dbmsKeys in dbms
Keys in dbms
 
ER Model in DBMS
ER Model in DBMSER Model in DBMS
ER Model in DBMS
 
RELATIONSHIP IN DBMS.pptx
RELATIONSHIP IN DBMS.pptxRELATIONSHIP IN DBMS.pptx
RELATIONSHIP IN DBMS.pptx
 
DBMS PPT
DBMS PPTDBMS PPT
DBMS PPT
 
ER to relational Mapping: Data base design using ER to relational language. C...
ER to relational Mapping: Data base design using ER to relational language. C...ER to relational Mapping: Data base design using ER to relational language. C...
ER to relational Mapping: Data base design using ER to relational language. C...
 
Sql server ___________session_17(indexes)
Sql server  ___________session_17(indexes)Sql server  ___________session_17(indexes)
Sql server ___________session_17(indexes)
 
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
Relational Database Design - Lecture 4 - Introduction to Databases (1007156ANR)
 
Entity relationship diagram (erd)
Entity relationship diagram (erd)Entity relationship diagram (erd)
Entity relationship diagram (erd)
 
Database Keys & Relationship
Database Keys & RelationshipDatabase Keys & Relationship
Database Keys & Relationship
 
Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)Database - Entity Relationship Diagram (ERD)
Database - Entity Relationship Diagram (ERD)
 
Logical Design and Conceptual Database Design
Logical Design and Conceptual Database DesignLogical Design and Conceptual Database Design
Logical Design and Conceptual Database Design
 
Database Keys
Database KeysDatabase Keys
Database Keys
 

Similar to 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
Rubal Sagwal
 
Data Models.pptx
Data Models.pptxData Models.pptx
Data Models.pptx
CheriviralaNikhil
 
entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptx
ThangamaniR3
 
Day 1 SQL.pptx
Day 1 SQL.pptxDay 1 SQL.pptx
Day 1 SQL.pptx
raghuKatagall1
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
raghuKatagall1
 
Er model
Er modelEr model
Er model
Surkhab Shelly
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship ModelSlideshare
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
Rupali Rana
 
Entityrelationshipmodel
EntityrelationshipmodelEntityrelationshipmodel
Entityrelationshipmodel
Enes Bolfidan
 
E - R Models.pptx SQL and plsql database
E - R Models.pptx SQL and plsql databaseE - R Models.pptx SQL and plsql database
E - R Models.pptx SQL and plsql database
ironman82715
 
Entity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptxEntity Relationship Diagram – ER Diagram in DBMS.pptx
Entity Relationship Diagram – ER Diagram in DBMS.pptx
sukrithlal008
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptx
sandeep54552
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).ppt
IshuIswarya3
 
ER-Diagram.pptx
ER-Diagram.pptxER-Diagram.pptx
ER-Diagram.pptx
SherinRappai1
 
Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..
Nimrakhan89
 
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
 
Unit iv dbms
Unit   iv dbmsUnit   iv dbms
Unit iv dbms
Arnav Chowdhury
 
er-models.pptx
er-models.pptxer-models.pptx
er-models.pptx
UmmerFarooq24
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
Dolchandra
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
Dolchandra
 

Similar to ERD(2).ppt (20)

ER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMSER Modeling and Introduction to RDBMS
ER Modeling and Introduction to RDBMS
 
Data Models.pptx
Data Models.pptxData Models.pptx
Data Models.pptx
 
entityrelationshipmodel.pptx
entityrelationshipmodel.pptxentityrelationshipmodel.pptx
entityrelationshipmodel.pptx
 
Day 1 SQL.pptx
Day 1 SQL.pptxDay 1 SQL.pptx
Day 1 SQL.pptx
 
SQL.pptx
SQL.pptxSQL.pptx
SQL.pptx
 
Er model
Er modelEr model
Er model
 
Entity Relationship Model
Entity Relationship ModelEntity Relationship Model
Entity Relationship Model
 
Revision ch 3
Revision ch 3Revision ch 3
Revision ch 3
 
Entityrelationshipmodel
EntityrelationshipmodelEntityrelationshipmodel
Entityrelationshipmodel
 
E - R Models.pptx SQL and plsql database
E - R Models.pptx SQL and plsql databaseE - R Models.pptx SQL and plsql database
E - R Models.pptx SQL and plsql database
 
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
 
E_R-Diagram (2).pptx
E_R-Diagram (2).pptxE_R-Diagram (2).pptx
E_R-Diagram (2).pptx
 
18306_lec-2 (1).ppt
18306_lec-2 (1).ppt18306_lec-2 (1).ppt
18306_lec-2 (1).ppt
 
ER-Diagram.pptx
ER-Diagram.pptxER-Diagram.pptx
ER-Diagram.pptx
 
Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..Advantages and disadvantages of er model in DBMS. Types of database models ..
Advantages and disadvantages of er model in DBMS. Types of database models ..
 
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
 
Unit iv dbms
Unit   iv dbmsUnit   iv dbms
Unit iv dbms
 
er-models.pptx
er-models.pptxer-models.pptx
er-models.pptx
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
 
rdbmsdol.pptx
rdbmsdol.pptxrdbmsdol.pptx
rdbmsdol.pptx
 

Recently uploaded

BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
Nguyen Thanh Tu Collection
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
Tamralipta Mahavidyalaya
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
Celine George
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
DeeptiGupta154
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
Jisc
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
Vikramjit Singh
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
SACHIN R KONDAGURI
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
JosvitaDsouza2
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
Vivekanand Anglo Vedic Academy
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
BhavyaRajput3
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
Pavel ( NSTU)
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
Jisc
 
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
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
Anna Sz.
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
GeoBlogs
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
Peter Windle
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
MysoreMuleSoftMeetup
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
EduSkills OECD
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
vaibhavrinwa19
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
Mohd Adib Abd Muin, Senior Lecturer at Universiti Utara Malaysia
 

Recently uploaded (20)

BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
BÀI TẬP BỔ TRỢ TIẾNG ANH GLOBAL SUCCESS LỚP 3 - CẢ NĂM (CÓ FILE NGHE VÀ ĐÁP Á...
 
Home assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdfHome assignment II on Spectroscopy 2024 Answers.pdf
Home assignment II on Spectroscopy 2024 Answers.pdf
 
How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17How to Make a Field invisible in Odoo 17
How to Make a Field invisible in Odoo 17
 
Overview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with MechanismOverview on Edible Vaccine: Pros & Cons with Mechanism
Overview on Edible Vaccine: Pros & Cons with Mechanism
 
The approach at University of Liverpool.pptx
The approach at University of Liverpool.pptxThe approach at University of Liverpool.pptx
The approach at University of Liverpool.pptx
 
Digital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and ResearchDigital Tools and AI for Teaching Learning and Research
Digital Tools and AI for Teaching Learning and Research
 
"Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe..."Protectable subject matters, Protection in biotechnology, Protection of othe...
"Protectable subject matters, Protection in biotechnology, Protection of othe...
 
1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx1.4 modern child centered education - mahatma gandhi-2.pptx
1.4 modern child centered education - mahatma gandhi-2.pptx
 
The French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free downloadThe French Revolution Class 9 Study Material pdf free download
The French Revolution Class 9 Study Material pdf free download
 
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCECLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
CLASS 11 CBSE B.St Project AIDS TO TRADE - INSURANCE
 
Synthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptxSynthetic Fiber Construction in lab .pptx
Synthetic Fiber Construction in lab .pptx
 
How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...How libraries can support authors with open access requirements for UKRI fund...
How libraries can support authors with open access requirements for UKRI fund...
 
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.
 
Polish students' mobility in the Czech Republic
Polish students' mobility in the Czech RepublicPolish students' mobility in the Czech Republic
Polish students' mobility in the Czech Republic
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
Embracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic ImperativeEmbracing GenAI - A Strategic Imperative
Embracing GenAI - A Strategic Imperative
 
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
Mule 4.6 & Java 17 Upgrade | MuleSoft Mysore Meetup #46
 
Francesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptxFrancesca Gottschalk - How can education support child empowerment.pptx
Francesca Gottschalk - How can education support child empowerment.pptx
 
Acetabularia Information For Class 9 .docx
Acetabularia Information For Class 9  .docxAcetabularia Information For Class 9  .docx
Acetabularia Information For Class 9 .docx
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 

ERD(2).ppt

  • 1. 1 Entity Relationship Modeling Objectives: • To illustrate how relationships between entities are defined and refined. • To know how relationships are incorporated into the database design process. • To describe how ERD components affect database design and implementation.
  • 2. 2 Entity-Relationship (ER) Modeling. • Entity Relationship (ER) Diagram – A detailed, logical representation of the entities, associations and data elements for an organization or business • Notation uses three main constructs – Data entities – Relationships – Attributes Chen Model & Crow’s Foot Model
  • 3. Person, place, object, event or concept about which data is to be maintained named property or characteristic of an entity Association between the instances of one or more entity types Represents a set or collection of objects in the real world that share the same properties Chen Notation EntityName Verb Phrase AttributeName
  • 4. Crow’s Foot Notation EntityName Entity Attribute EntityName List of Attributes Relationship Verb phrase
  • 5. 5 2.1 Entities • Examples of entities: – Person: EMPLOYEE, STUDENT, PATIENT – Place: STORE, WAREHOUSE – Object: MACHINE, PRODUCT, CAR – Event: SALE,REGISTRATION, RENEWAL – Concept: ACCOUNT, COURSE • Guidelines for naming and defining entity types: – An entity type should be descriptive and specific – An entity name should be concise – Event entity types should be named for the result of the event, not the activity or process of the event.
  • 6. 6 2.2 Attributes • Example of entity types and associated attributes: STUDENT: Student_ID, Student_Name, Home_Address, Phone_Number, Major • Guidelines for naming attributes: – An attribute name is a noun. – An attribute name should be unique – To make an attribute name unique and clear, each attribute name should follow a standard format – Similar attributes of different entity types should use similar but distinguishing names.
  • 8. 8 2.3 Relationships  Associations between instances of one or more entity types that is of interest  Given a name that describes its function. • relationship name is an active or a passive verb. Author Book Relationship name: writes An author writes one or more books A book can be written by one or more authors.
  • 9. 9 2.3.1 Degree of Relationships • Degree: number of entity types that participate in a relationship • Three cases – Unary: between two instances of one entity type – Binary: between the instances of two entity types – Ternary: among the instances of three entity types
  • 10. 10 main components and its symbols in ER Diagrams: Following are the main components and its symbols in ER Diagrams: •Rectangles: This Entity Relationship Diagram symbol represents entity types •Ellipses : Symbol represent attributes •Diamonds: This symbol represents relationship types •Lines: It links attributes to entity types and entity types with other relationship types •Primary key: attributes are underlined •Double Ellipses: Represent multi-valued attributes
  • 11. 11 Attribute • An attribute describes the property of an entity. An attribute is represented as Oval in an ER diagram. There are four types of attributes: • 1. Key attribute 2. Composite attribute 3. Multivalued attribute 4. Derived attribute
  • 12. 12 key attribute • A key attribute can uniquely identify an entity from an entity set. For example, student roll number can uniquely identify a student from a set of students. Key attribute is represented by oval same as other attributes however the text of key attribute is underlined.
  • 13. 13 composite attribute An attribute that is a combination of other attributes is known as composite attribute. For example, In student entity, the student address is a composite attribute as an address is composed of other attributes such as pin code, state, country.
  • 14. 14 Multivalued attribute: • An attribute that can hold multiple values is known as multivalued attribute. It is represented with double ovals in an ER Diagram. For example – A person can have more than one phone numbers so the phone number attribute is multivalued.
  • 15. 15 4. Derived attribute: • A derived attribute is one whose value is dynamic and derived from another attribute. It is represented by dashed oval in an ER Diagram. For example – Person age is a derived attribute as it changes over time and can be derived from another attribute (Date of birth).
  • 16. 16 Participation Constraints • Total Participation − Each entity is involved in the relationship. Total participation is represented by double lines. • Partial participation − Not all entities are involved in the relationship. Partial participation is represented by single lines.
  • 17. 17 • A relationship where two entities are participating is called a binary relationship. Cardinality is the number of instance of an entity from a relation that can be associated with the relation.
  • 18. 18 One-to-one − • When only one instance of an entity is associated with the relationship, it is marked as '1:1'.
  • 19. 19 One-to-many • One-to-many − When more than one instance of an entity is associated with a relationship, it is marked as '1:N'.
  • 20. 20 Many-to-one • Many-to-one − When more than one instance of entity is associated with the relationship, it is marked as 'N:1'.
  • 21. 21 Many-to-many • Many-to-many − The following image reflects that more than one instance of an entity on the left and more than one instance of an entity on the right can be associated with the relationship. It depicts many-to- many relationship. •
  • 22. 22 2.4 Cardinality and Connectivity • Relationships can be classified as either • one – to – one • one – to – many • many – to –many • Cardinality : minimum and maximum number of instances of Entity B that can (or must be) associated with each instance of entity A. Connectivity
  • 23. 23 2.4.1 Connectivity • Chen Model – 1 to represent one. – M to represent many • Crow’s Foot many One One or many 1 M Mandatory one , means (1,1) Optional? – we’ll see after this
  • 24. 24 2.4 Cardinality and Connectivity Professor Class teaches A professor teaches class OR A class is taught by professor How Many?? Professor Class teaches
  • 25. 25 Strong Entity • Strong Entity is independent to any other entity in the schema. • A strong entity always have a primary key. In ER diagram, a strong entity is represented by rectangle. • Relationship between two strong entities is represented by a diamond. • A set of strong entities is known as strong entity set.
  • 26. 26
  • 27. 27 Weak Entity • Weak entity is dependent on strong entity and cannot exists without a corresponding strong. • It has a foreign key which relates it to a strong entity. A weak entity is represented by double rectangle. • Relationship between a strong entity and a weak entity is represented by double diamond. The foreign key is also called a partial discriminator key.
  • 28. 28
  • 29. 29 Strong Entity Set Weak Entity Set Strong entity set always has a primary key. It does not have enough attributes to build a primary key. It is represented by a rectangle symbol. It is represented by a double rectangle symbol. It contains a Primary key represented by the underline symbol. It contains a Partial Key which is represented by a dashed underline symbol. The member of a strong entity set is called as dominant entity set. The member of a weak entity set called as a subordinate entity set. Primary Key is one of its attributes which helps to identify its member. In a weak entity set, it is a combination of primary key and partial key of the strong entity set. In the ER diagram the relationship between two strong entity set shown by using a diamond symbol. The relationship between one strong and a weak entity set shown by using the double diamond symbol. The connecting line of the strong entity set with the relationship is single. The line connecting the weak entity set for identifying relationship is double. Comparing Strong Entity and weak Entity
  • 30. 30 What are Keys in DBMS? • KEYS in DBMS is an attribute or set of attributes which helps you to identify a row(tuple) in a relation(table). • They allow you to find the relation between two tables. • Key is also helpful for finding unique record or row from the table. Database key is also helpful for finding unique record or row from the table.
  • 31. 31 Employee ID FirstName LastName 11 Andrew Johnson 22 Tom Wood 33 Alex Hale
  • 32. 32 Types of Keys in DBMS (Database Management System)
  • 34. 34 Primary Key Primary Key: There can be more than one candidate key in relation out of which one can be chosen as the primary key. For Example, STUD_NO, as well as STUD_PHONE both, are candidate keys for relation STUDENT but STUD_NO can be chosen as the primary key (only one out of many candidate keys).
  • 35. 35 Candidate Key: • The minimal set of attributes that can uniquely identify a tuple is known as a candidate key. • For Example, STUD_NO in STUDENT relation. • The candidate key can be simple (having only one attribute) or composite as well. For Example, {STUD_NO, COURSE_NO} is a composite candidate key for relation
  • 36. 36 • Super Key: The set of attributes that can uniquely identify a tuple is known as Super Key. For Example, STUD_NO, (STUD_NO, STUD_NAME), etc. • Adding zero or more attributes to the candidate key generates the super key. • A candidate key is a super key but vice versa is not true.
  • 37. 37 Alternate Key: • The candidate key other than the primary key is called an alternate key. • For Example, STUD_NO, as well as STUD_PHONE both, are candidate keys for relation STUDENT but STUD_PHONE will be an alternate key (only one out of many candidate keys).
  • 38. 38 Foreign keys • Foreign keys are the column of the table which is used to point to the primary key of another table.
  • 39. 39 Composite Key • A composite key is a key that contains two or more attributes that help to identify a record in the table uniquely. • we have to use this combination to identify the records separately. It is not possible to use individual attributes to identify the records.
  • 40. 40 • For example, assume that there is a table to store the marks of the students. • It has 4 attributes or columns: student_id, subject_id, marks and exam_name. • In this table, we cannot consider either the student_id or the subject_id as the primary key because we cannot uniquely identify the records by using them. However, we can identify each record by using the combination of student_id and subject_id. Therefore, this combination is the primary key. Furthermore, this combination is also a composite key.
  • 41. 41 Candidate Key vs Composite key
  • 42. 42 Surrogate key Surrogate key also called a synthetic primary key, is generated when a new record is inserted into a table automatically by a database that can be declared as the primary key of that table . It is the sequential number outside of the database that is made available to the user and the application or it acts as an object that is present in the database but is not visible to the user or application.
  • 43. 43 Example Suppose we have two tables of two different schools having the same column registration_no , name and percentage , each table having its own natural primary key, that is registration_no. Table A Table B registration_n o name percentage CS107 Taylor 49 CS108 Simon 86 CS109 Sam 96 CS110 Andy 58 registration_n o name percentage 210101 Harry 90 210102 Maxwell 65 210103 Lee 87 210104 Chris 76
  • 44. 44 Now, suppose we want to merge the details of both the schools in a single table . Resulting table will be –
  • 46. 46 Sectorsssss Use of DBMS Banking For customer information, account activities, payments, deposits, loans, etc. Airlines For reservations and schedule information. Universities For student information, course registrations, colleges and grades. Telecommunication It helps to keep call records, monthly bills, maintaining balances, etc. Finance For storing information about stock, sales, and purchases of financial instruments like stocks and bonds. Sales Use for storing customer, product & sales information. Manufacturing It is used for the management of supply chain and for tracking production of items. Inventories status in warehouses. HR Management For information about employees, salaries, payroll, deduction, generation of paychecks, etc.