SlideShare a Scribd company logo
1 of 97
Course – DBMS
Course Instructor
Dr. Umadevi V
Department of CSE, BMSCE
24 January 2024 CSE, BMSCE
1
Unit-2
Data Modelling using the Entity-Relationship(ER) model: Using High-
Level conceptual Data Models for Database Design, A sample Database
Application, Entity types, Entity Sets, Attributes and Keys, Relationship
Types, Relationship Sets, Roles and Structural Constraints, Weak Entity
types, Refining the ER Design, ER Diagrams, Relationship Types of Degree
Higher than two, Relational Database Design using ER-to-Relational
Mapping.
Relational Algebra: Unary Relational Operations, SELECT and PROJECT,
Relational Algebra Operations from Set Theory
Binary Relational Operations: JOIN and DIVISION, Additional Relational
Operations, Examples of Queries in Relational Algebra.
24 January 2024 CSE, BMSCE 2
Unit-2
Data Modeling using the Entity-Relationship(ER)
diagram
- Entity Types, Entity Sets, Attributes and Keys
24 January 2024 CSE, BMSCE 3
Sample Database Application
 Example: HOD of CSE department calls you and asks to
develop the following application
“Develop a database application to automate the process of
course registration”
 Your first task should be to have a discussion with your
client i.e., HOD, to identify the requirements of the
application.
 Requirements are as follows
 Department has students and faculty
 Department will offer a set of courses during each semester
 Each student in the department during course registration will be opting for
courses offered by the department
 Faculty will be handling courses
 Your second task should be to prepare a ER diagram
which shows the Design plan of the database application
to be developed.
24 January 2024 CSE, BMSCE 4
Example: House design plan
24 January 2024 CSE, BMSCE 5
During plan preparation
Various notations and
Terminologies
Design plan or ER diagram before actual development of the
application
24 January 2024 CSE, BMSCE 6
Student
USN Name
Opting
Courses
Course
Code
Course
Name
Department
Name
Offers
has
Faculty
ID
Handles
has
Name
Design plan or ER diagram before actual development of the
application
24 January 2024 CSE, BMSCE 7
Requirements Were
- Department has students and faculty
- Department will offer a set of courses during each semester
- Each student in the department during course registration will be
opting for courses offered by the department
- Faculty will be handling courses
Entity
Attribute
Relationship
Design plan or ER diagram before actual development of the
application
24 January 2024 CSE, BMSCE 8
Requirements Were
- Department has students and faculty
- Department will offer a set of courses during each semester
- Each student in the department during course registration will be
opting for courses offered by the department
- Faculty will be handling courses
Constraints
- Each semester student
should register for minimum
of 20 credits and maximum
of 30 credits
- Each faculty can handle
a maximum two courses
during each semester
What is ER diagram ?
 An Entity–Relationship model (ER model) describes the
structure of a database with the help of a diagram,
which is known as Entity Relationship Diagram (ER
Diagram).
 An ER model is a design or blueprint of a database that
can later be implemented as a database.
 It develops a conceptual design for the database. It
also develops a very simple and easy to design view of
data.
24 January 2024 CSE, BMSCE 9
What is Entity, Entity Types, Entity sets ?
 Entity is object in real world which has
independent existence.
 Example: Student, Course, Faculty, Car,
House, College, Book, Food
24 January 2024 CSE, BMSCE 10
ER Diagram Notation for Entity: Rectangle
Student Courses
What is Entity Types, Entity sets ?
 Entity type is collection of entities with
common attributes
 Entity set collection of one or more attributes
24 January 2024 CSE, BMSCE 11
USN Name Email ID Mobile No. DOB
1BM14CS001 Aditya aditya@bmsce.ac.in 9448444160 1-1-1997
1BM14CS002 Bharath bharath@bmsce.ac.in 8762244699 31-12-1996
Student Entity Type
Entity Set
What is Attribute ?
 Attribute is a property that describes Entity.
24 January 2024 CSE, BMSCE 12
USN Name Email ID Mobile No. DOB
1BM14CS001 Aditya aditya@bmsce.ac.in 9448444160 1-1-1997
1BM14CS002 Bharath bharath@bmsce.ac.in 8762244699 31-12-1996
Student Entity Type
Entity Set
Attributes:
USN, Name, Email ID,
Mobile Number, DOB
What is Domain ?
Set of permitted values for an attribute.
What is Attribute ?
 Attribute is a property that describes Entity.
24 January 2024 CSE, BMSCE 13
USN Name Email ID Mobile No. DOB
1BM14CS001 Aditya aditya@bmsce.ac.in 9448444160 1-1-1997
1BM14CS002 Bharath bharath@bmsce.ac.in 8762244699 31-12-1996
Student Entity Type
Entity Set
Attributes:
USN, Name, Email ID,
Mobile Number, DOB
ER Diagram Notation for Attribute: Ellipse
Student
USN Name
Email ID Mobile
No.
DOB
Activity - Questionnaire
List attributes for
1. Car
2. Book
24 January 2024 CSE, BMSCE 14
Example
Few attributes of Car are
Car_ID, Car_type, Car_color, Car_make…
Few attributes of Book are
Book_ID, Book_Title, Book_Publisher….
24 January 2024 CSE, BMSCE 15
Different categories of attributes
 Simple (Atomic) vs Composite
 Attributes that are not divisible are called Simple.
 Attributes that can be divided into smaller parts are called
Composite.
 Ex.: Simple- USN, Composite- Name(First Name, Last Name),
Address(Street name, Area Name, Place)
 Single value vs Multiple valued
 Ex.: Single – USN, Multiple – Mobile numbers
 Stored vs Derived
 Ex.: Stored – DOB, Derived – Age
 Complex Attributes
 Ex.: {Address(Street name, Area Name, Place)}  Office address
and Residence Address
 Null values
 Ex. : Middle Name is Optional i.e. Gautham Sharma or Gautham K
Sharma
24 January 2024 CSE, BMSCE 16
Attribute: ER diagram notations
24 January 2024 CSE, BMSCE 17
Attribute
…..
Composite Attribute
Multivalued Attribute
Derived Attribute
What is Key ?
 Key attribute is a attribute or a combination of
attributes which will uniquely identify
remaining attributes of entity.
24 January 2024 CSE, BMSCE 18
USN Name Email ID Mobile No. DOB
1BM14CS001 Aditya aditya@bmsce.ac.in 9448444160 1-1-1997
1BM14CS002 Bharath bharath@bmsce.ac.in 8762244699 31-12-1996
ER Diagram Notation for Entity: Rectangle USN
Activity To DO
24 January 2024 CSE, BMSCE 19
Attribute
…..
Composite Attribute
Multivalued Attribute
Derived Attribute
Entity
Key Attribute
______
Represent Employee entity
using ER diagram notation
Which has following attributes
- Employee ID (Key)
- Name
- Address(House No., Street
name, Area name, Place)
- Mobile Number (Can have
more than one )
- DOB
- Age
Next we will learn
Unit 2:
- Relationship Types, Relationship sets, Roles and
Structural Constraints
- Weak Entity Types
24 January 2024 CSE, BMSCE 20
Relationship Type
 A relationship type represents the association between
entity types
 Example, an Faculty works_for a department, a student
enrolls_for in a course. Here, works_for and enrolls_for
are called relationships.
24 January 2024 CSE, BMSCE 21
Faculty Works_for
Department
Student Enrolls_for
Course
relationship
Relationship Type
 A Relationship Type defines a relationship set among entities of certain
entity types.
 Example, an Faculty works_for a department, a student enrolls_for in a
course. Here, works_for and enrolls_for are called relationships.
24 January 2024 CSE, BMSCE 22
Dr. Guruprasad
Dr. Umadevi
Dr. Indiramma
Dr. Ashok
CSE
ISE
Works_for
relationship
Faculty
Entity
Department
Entity
Relationship Type
 A Relationship Type defines a relationship set among entities of certain
entity types.
 Example, an Faculty works_for a department, a student enrolls_for in a
course. Here, works_for and enrolls are called relationships.
24 January 2024 CSE, BMSCE 23
Avinash
Balaji
Chandan
Dinesh
DBMS
Java
enrolls_for
relationship
Student
Entity
Course
Entity
Relationship Set
 An Relationship Set is a collection of relationships all belonging to
one relationship type.
24 January 2024 CSE, BMSCE 24
Avinash
Balaji
Chandan
Dinesh
DBMS
Java
enrolls_for
relationship
Student
Entity
Course
Entity
Here relationship set,
has 4 relationships
Relationship
 The association among entities is called a
relationship. or A Relationship is one
instance in a Relationship Set.
24 January 2024 CSE, BMSCE 25
Avinash
Balaji
Chandan
Dinesh
DBMS
Java
enrolls_for
relationship
Student
Entity
Course
Entity
Relationship Degree
 Binary Relationship: Degree two, two
entities are participating
24 January 2024 CSE, BMSCE 26
Dr. Guruprasad
Dr. Umadevi
Dr. Indiramma
Dr. Ashok
CSE
ISE
Works_for
relationship
Faculty
Entity
Department
Entity
Relationship Degree
 Ternary Relationship: Degree three, three
entities are participating
24 January 2024 CSE, BMSCE 27
Micro Systems
Pvt. Ltd
UNIQ systems
Pvt. Ltd
Laptop
Manufacturing
Desktop
Manufacturing
supplies
relationship
Supplier
Entity
Project
Entity
Hard disk
Keyboard
Part
Entity
Relationship Degree
 Ternary Relationship: Degree three, three
entities are participating
24 January 2024 CSE, BMSCE 28
Micro Systems
Pvt. Ltd
UNIQ systems
Pvt. Ltd
Laptop
Manufacturing
Desktop
Manufacturing
supplies
relationship
Supplier
Entity
Project
Entity
Hard disk
Keyboard
Part
Entity
Recursive Relationship
 In some cases the same entity type participates in
more than once in a relationship type in different
roles.
24 January 2024 CSE, BMSCE 29
Dr. Guruprasad
Dr. Umadevi
Dr. Indiramma
supervision
relationship
Faculty
Entity
Supervisor
Subordinate
Subordinate
Recursive Relationship
 In some cases the same entity type participates in
more than once in a relationship type in different
roles.
24 January 2024 CSE, BMSCE 30
Dr. Guruprasad
Dr. Umadevi
Dr. Indiramma
Principal
supervision
relationship
Faculty
Entity
Supervisor
Supervisor
Subordinate
ER Diagram Notations
24 January 2024 CSE, BMSCE 31
Attribute
…..
Composite Attribute
Multivalued Attribute
Derived Attribute
Entity
Key Attribute
______
Relationship
Relationship Constraints or Structural Constraints
Two Types
1. Cardinality Ratios
a. One to one (1:1)
b. One to Many (1:M)
c. Many to Many (N:M)
2. Participation Constraints
a. Total
b. Partial
24 January 2024 CSE, BMSCE 32
Cardinality Ratios
 Cardinality is a constraint on a relationship specifying the
number of entity instances that a specific entity may be
related to via the relationship.
One to One:
One entity from entity set A can be associated with at most
one entity of entity set B and vice versa.
24 January 2024 CSE, BMSCE 33
Cardinality Ratios
 Cardinality is a constraint on a relationship specifying the
number of entity instances that a specific entity may be
related to via the relationship.
One to One:
One entity from entity set A can be associated with at most
one entity of entity set B and vice versa.
24 January 2024 CSE, BMSCE 34
Dr. Guruprasad
Dr. Gowrishankar
CSE
ISE
Heads
relationship
Faculty
Entity
Department
Entity
Cardinality Ratios
 Cardinality is a constraint on a relationship specifying the
number of entity instances that a specific entity may be
related to via the relationship.
One to One:
One instance of one entity type can participate in one
instance of other entity type.
24 January 2024 CSE, BMSCE 35
Faculty Heads Department
1 1
Cardinality Ratios
 Cardinality is a constraint on a relationship specifying the
number of entity instances that a specific entity may be related
to via the relationship.
One to Many:
One entity from entity set A can be associated with more than one
entities of entity set B however an entity from entity set B, can be
associated with at most one entity.
24 January 2024 CSE, BMSCE 36
R Entity B
1
Entity A
M
Cardinality Ratios
 Cardinality is a constraint on a relationship specifying the
number of entity instances that a specific entity may be related
to via the relationship.
One to Many:
One entity from entity set A can be associated with more than one
entities of entity set B however an entity from entity set B, can be
associated with at most one entity.
24 January 2024 CSE, BMSCE 37
Has Student
1
Departme
nt
M
Cardinality Ratios
 Cardinality is a constraint on a relationship specifying the
number of entity instances that a specific entity may be related
to via the relationship.
Many to Many:
One entity from A can be associated with more than one entity
from B and vice versa.
24 January 2024 CSE, BMSCE 38
R Entity B
N
Entity A
M
Cardinality Ratios
 Cardinality is a constraint on a relationship specifying the
number of entity instances that a specific entity may be related
to via the relationship.
Many to Many:
One entity from A can be associated with more than one entity
from B and vice versa.
24 January 2024 CSE, BMSCE 39
Cardinality Ratios
 Cardinality is a constraint on a relationship specifying the
number of entity instances that a specific entity may be related
to via the relationship.
Many to Many:
One entity from A can be associated with more than one entity
from B and vice versa.
24 January 2024 CSE, BMSCE 40
Participation Constraint
 Minimum number of relationship instance that each entity can
participate in.
 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.
24 January 2024 CSE, BMSCE 41
Participation Constraint
 Minimum number of relationship instance that each
entity can participate in.
 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.
24 January 2024 CSE, BMSCE 42
Participation Constraint
 Minimum number of relationship instance that each entity can
participate in.
 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.
24 January 2024 CSE, BMSCE 43
Participation Constraint
 Minimum number of relationship instance that each entity can
participate in.
 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.
24 January 2024 CSE, BMSCE 44
What is wrong in following relationship representation ?
Participation Constraint
 Minimum number of relationship instance that each entity can
participate in.
 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.
24 January 2024 CSE, BMSCE 45
Weak Entity
A weak entity set is one which does not have any primary key
associated with it.
A weak entity type normally has partial key which is the set of attributes
that can uniquely identify weak entities that are related to same owner
entity.
The relationship that relates the weak entity type to an owner entity type is
known as identifying relationship. The weak entity type always has total
participation(existence dependency) in a relationship because the weak
entity type can not be identified without an owner identity.
24 January 2024 CSE, BMSCE 46
Faculty Dependents_of
Dependent
Name
-----
Partial
Key
Weak
Entity
Owner
Entity Identifying
Relationship
Weak Entity
 A weak entity set is one which does not have any
primary key associated with it.
 A weak entity type normally has partial key which is the
set of attributes that can uniquely identify weak entities
that are related to same owner entity.
24 January 2024 CSE, BMSCE 47
Dr. Sharma
Dr. Reddy
Ram
Ravi
Ram
Dependents_of
relationship
Owner
Entity Dependent (Children)
Entity
ER Diagram Symbols
24 January 2024 CSE, BMSCE 48
Attribute
…..
Composite Attribute
Multivalued Attribute
Derived Attribute
Entity
Key Attribute
______
Weak Entity
Partial Key
_ _ _ _
ER Diagram Symbols
24 January 2024 CSE, BMSCE 49
Relationship
Identifying Relationship
Total Participation of Entity A in R
Cardinality Ratio 1:N for Entity A : B in R
Topics Covered in Todays Class
Unit 2:
ER diagram design for a given requirements
24 January 2024 CSE, BMSCE 50
Database Design
Database design: Why do we need it ?
 Agree on structure of the database before deciding on a
particular implementation
Consideration Issues such as:
 What entities to model
 How entities are related
 What constraints exist in the domain
 How to achieve good design
ER diagram is a conceptual design of database
24 January 2024 CSE, BMSCE 51
Database Design Process
24 January 2024 CSE, BMSCE 52
Requirement
Analysis
Conceptual
Design
Logical, Physical,
Security etc.,
Requirement Analysis
- What is going to be stored ?
- How is it going to be used ?
- What are we going to do with the data ?
- Who should access the data ?
Technical and Non-technical
people are involved
Database Design Process
24 January 2024 CSE, BMSCE 53
Requirement
Analysis
Conceptual
Design
Logical, Physical,
Security etc.,
Conceptual Design
- A high-level description of the database.
- Sufficiently precise that technical people can understand it.
- But, not so precise that non-technical can not participate.
This is were Entity-Relationship (ER)
Diagram fits in.
Database Design Process
24 January 2024 CSE, BMSCE 54
Requirement
Analysis
Conceptual
Design
Logical, Physical,
Security etc.,
ER diagram is visual syntax for DB design which
is precise enough for technical points, but abstracted
enough for non-technical people.
Main phases of Database Design
24 January 2024 CSE, BMSCE 55
Main phases of Database Design
The first step shown is requirements collection and analysis. During this
step, the database designers interview prospective database users to
understand and document their data requirements.
The next step is to create a conceptual schema for the database, using a
high-level conceptual data model. This step is called conceptual design. The
conceptual schema is a concise description of the data requirements of the
users and includes detailed descriptions of the entity types, relationships,
and constraints; these are expressed using the concepts provided by the
high-level data model
The next step in database design is the actual implementation of the
database, using a commercial DBMS. This step is called logical design or
data model mapping; its result is a database schema in the implementation
data model of the DBMS.
The last step is the physical design phase, during which the internal storage
structures, file organizations, indexes, access paths, and physical design
parameters for the database files are specified. In parallel with these
activities, application programs are designed and implemented as database
transactions corresponding to the high level transaction specifications.
24 January 2024 CSE, BMSCE 56
ER Diagram Symbols
24 January 2024 CSE, BMSCE 57
Attribute
…..
Composite Attribute
Multivalued Attribute
Derived Attribute
Entity
Key Attribute
______
Weak Entity
Partial Key
_ _ _ _
ER Diagram Symbols
24 January 2024 CSE, BMSCE 58
Relationship
Identifying Relationship
Total Participation of Entity A in R
Cardinality Ratio 1:N for Entity A : B in R
Activity: ER diagram
Decision: Relationship vs Empty
Question 1: What does the following ER diagram
say ?
24 January 2024 CSE, BMSCE 59
Activity: ER diagram
Decision: Relationship vs Empty
Question 2: What does the following ER diagram
say ?
24 January 2024 CSE, BMSCE 60
Activity: ER diagram
Decision: Relationship vs Empty
Question 3: What does the following ER diagram
say ?
24 January 2024 CSE, BMSCE 61
Activity: ER diagram design
Draw ER diagram for the following requirements
Universal Records has decided to store information about musicians who
perform on its albums (as well as other company data) in a database.
 Each musician that records at Universal has an ID(Key) and name.
 Each instrument used in songs recorded at Universal has a unique
identification number (Key) , a name and a musical key.
 Each album recorded on the Universal label has a unique identification
number (Key) , a title, a copyright date and a format.
 Each song recorded at Universal has a Song ID (Key), a title and an
author.
 Each musician may play several instruments, and a given instrument
may be played by several musicians.
 Each album has a number of songs on it, but no song may appear on
more than one album.
 Each song is performed by one or more musicians, and a musician may
perform a number of songs.
 Each album has exactly one musician who acts as its producer. A
musician may produce several albums, of course.
24 January 2024 CSE, BMSCE 62
Each musician that records at Universal has an ID (Key) and
name.
24 January 2024 CSE, BMSCE 63
Each instrument used in songs recorded at Universal has a unique
identification number (Key) , a name and a musical key.
24 January 2024 CSE, BMSCE 64
Each album recorded on the Universal label has a unique
identification number (Key) , a title, a copyright date and a format.
24 January 2024 CSE, BMSCE 65
Each song recorded at Universal has a Song ID
(Key), a title and an author.
24 January 2024 CSE, BMSCE 66
Each musician may play several instruments, and a given
instrument may be played by several musicians.
24 January 2024 CSE, BMSCE 67
M
N
Each album has a number of songs on it, but no song may
appear on more than one album.
24 January 2024 CSE, BMSCE 68
1
M
Each song is performed by one or more musicians, and a
musician may perform a number of songs.
24 January 2024 CSE, BMSCE 69
M
N
M
N
N
1
Each album has exactly one musician who acts as its
producer. A musician may produce several albums, of course
24 January 2024 CSE, BMSCE 70
M
N
M
N
M
1
1
M
Next we will Learn
Unit 2:
- Converting ER Diagrams to Tables
or Database design using ER-to-Relational Mapping
24 January 2024 CSE, BMSCE 71
ER diagram
 An ER diagram is a pictorial
representation of the information that
can be captured by a database. Such a
“picture” serves two purposes:
 It allows database professionals to describe an
overall design concisely yet accurately.
 (Most of) it can be easily transformed into the
relational schema.
 The ER diagram represents the conceptual
level of database design meanwhile the
relational schema (or database table) is the
logical level for the database design.
24 January 2024 CSE, BMSCE 72
Converting ER diagram to Tables
 Entities and Simple Attributes
 An entity type within ER diagram is turned into a
table.
 Each attribute turns into a column (attribute) in the
table. The key attribute of the entity is the primary
key of the table which is usually underlined.
24 January 2024 CSE, BMSCE 73
Student
USN
Name
DOB
USN Name DOB
1BM14CS001 Aditya 1-1-1997
1BM14CS002 Bharath 31-12-1996
Primary
Key
Student Table
Converting ER diagram to Tables
 Multi-Valued Attributes
24 January 2024 CSE, BMSCE 74
Student
USN
Name
Mobile
DOB
Converting ER diagram to Tables
 Multi-Valued Attributes
24 January 2024 CSE, BMSCE 75
Student
USN
Name
Mobile
DOB
Which of the following representation of the table for Multivalued
Attribute is best ?
USN Name DOB Mobile 1 Mobile 2
1BM14CS001 Aditya 1-1-1997 8766655433
1BM14CS002 Bharath 31-12-1996 9762255433 7066722433
USN Mobile
1BM14CS001 8766655433
1BM14CS002 9762255433
1BM14CS002 7066722433
USN Name DOB
1BM14CS001 Aditya 1-1-1997
1BM14CS002 Bharath 31-12-1996
Student Table Mobile Table
Converting ER diagram to Tables
 Multi-Valued Attributes
24 January 2024 CSE, BMSCE 76
Student
USN
Name
Mobile
DOB
USN Mobile
1BM14CS001 8766655433
1BM14CS002 9762255433
1BM14CS002 7066722433
USN Name DOB
1BM14CS001 Aditya 1-1-1997
1BM14CS002 Bharath 31-12-1996
Student Table Mobile Table
If you have a multi-valued attribute, take the attribute and turn it into a
new entity or table of its own. Then make a 1:N relationship between
the new entity and the existing one. In simple words,
1. Create a table for the attribute.
2. Add the primary (id) column of the parent entity as a foreign key
within the new table
Primary
Key
Foreign
Key
Converting ER diagram to Tables
 Composite Attribute
24 January 2024 CSE, BMSCE 77
Student
USN Name
Mobile
DOB Address
Street
Name
Area
Name
Place
Converting ER diagram to Tables
 Composite Attribute
24 January 2024 CSE, BMSCE 78
Student
USN Name
Mobile
DOB Address
Street
Name
Area
Name
Place
USN Mobile
1BM14CS001 8766655433
1BM14CS002 9762255433
1BM14CS002 7066722433
USN Name DOB Street Area Place
1BM14CS001 Aditya 1-1-1997 RK Road Nagar Mandya
1BM14CS002 Bharath 31-7-1996 S V Road Layout Kolar
Student Table
Mobile Table
Converting ER diagram to Tables
 Derived Attribute
24 January 2024 CSE, BMSCE 79
Student
USN Name
Mobile
DOB Address
Street
Name
Area
Name
Place
USN Mobile
1BM14CS001 8766655433
1BM14CS002 9762255433
1BM14CS002 7066722433
USN Name DOB Street Area Place
1BM14CS001 Aditya 1-1-1997 RK Road Nagar Mandya
1BM14CS002 Bharath 31-7-1996 S V Road Layout Kolar
Student Table
Mobile Table
Age
Converting ER diagram to Tables
 Relationship: One-to-One
24 January 2024 CSE, BMSCE 80
1
1
F-ID
F-Name
D-ID
D-Name
Converting ER diagram to Tables
 Relationship: One-to-One
24 January 2024 CSE, BMSCE 81
1
1
F-ID
F-Name
D-ID
D-Name
Approach 1: Foreign Key
F-ID F-Name
1 Dr. H S Guruprasad
2 Dr. Umadevi V
3 Dr. Gowrishankar
Faculty Table
D-
ID
D-Name Heading
F-ID
10 CSE 1
20 ISE 3
Department Table
Converting ER diagram to Tables
 Relationship: One-to-One
24 January 2024 CSE, BMSCE 82
1
1
F-ID
F-Name
D-ID
D-Name
Approach 1: Foreign Key
F-ID F-Name
1 Dr. H S Guruprasad
2 Dr. Umadevi V
3 Dr. Gowrishankar
Faculty Table
D-
ID
D-Name Heading
F-ID
10 CSE 1
20 ISE 3
Department Table
Primary
Key
Foreign
Key
Primary
Key
Converting ER diagram to Tables
 Relationship: One-to-One
24 January 2024 CSE, BMSCE 83
1
1
F-ID
F-Name
D-ID
D-Name
Approach 2: Merged Relation approach
Merging two entity types and relationship into one single relation.
This may be appropriate when both participations are total
F-
ID
F-Name D-ID D-Name HOD
1 Dr. H S Guruprasad 10 CSE Yes
2 Dr. Umadevi V 10 CSE No
3 Dr. Gowrishankar 20 ISE Yes
Faculty –Department Table
Converting ER diagram to Tables
 Relationship: One-to-One
24 January 2024 CSE, BMSCE 84
1
1
F-ID
F-Name
D-ID
D-Name
Approach 3: Cross-reference or relationship relation approach
F-ID F-Name
1 Dr. H S Guruprasad
2 Dr. Umadevi V
3 Dr. Gowrishankar
Faculty Table
D-
ID
D-Name
10 CSE
20 ISE
Department Table
D-ID F-ID
10 1
20 3
HOD Table
Lookup Table
Converting ER diagram to Tables
 Relationship: One-to-Many
24 January 2024 CSE, BMSCE 85
Has Student
1
Departme
nt
M
D-ID
D-Name
USN
S-Name
Converting ER diagram to Tables
 Relationship: One-to-Many
24 January 2024 CSE, BMSCE 86
Has Student
1
Departme
nt
M
D-ID
D-Name
USN
S-Name
D-ID D-Name
10 CSE
20 ISE
Department Table USN S-Name D-ID
1BM14CS001 Akash 10
1BM14CS002 Bharath 10
1BM14CS003 Ragu 10
1BM14CS004 Mohan 20
1BM14CS005 Nikil 20
Student Table
Approach 1
Converting ER diagram to Tables
 Relationship: One-to-Many
24 January 2024 CSE, BMSCE 87
Has Student
1
Departme
nt
M
D-ID
D-Name
USN
S-Name
D-ID D-Name
10 CSE
20 ISE
Department Table USN S-Name
1BM14CS001 Akash
1BM14CS002 Bharath
1BM14CS003 Ragu
1BM14CS004 Mohan
1BM14CS005 Nikil
Student Table
USN D-ID
1BM14CS001 10
1BM14CS002 10
1BM14CS003 10
1BM14CS004 20
1BM14CS005 20
Department
Student Table
Approach 2
Converting ER diagram to Tables
 Relationship: Many-to-Many
24 January 2024 CSE, BMSCE 88
Student Enrolls_for
Course
USN
S-Name
C-ID
C-Name
Converting ER diagram to Tables
 Relationship: Many-to-Many
24 January 2024 CSE, BMSCE 89
C-ID C-Name
10 DBMS
20 Java
Course Table
USN S-Name
1BM14CS001 Avinash
1BM14CS002 Balaji
1BM14CS003 Chandan
Student Table
USN C-ID
1BM14CS001 10
1BM14CS001 20
1BM14CS002 20
1BM14CS003 10
Student
Course Table
Student Enrolls_for
Course
USN
S-Name
C-ID
C-Name
Converting ER diagram to Tables
 Relationship: Many-to-Many
24 January 2024 CSE, BMSCE 90
C-ID C-Name
10 DBMS
20 Java
Course Table
USN S-Name
1BM14CS001 Avinash
1BM14CS002 Balaji
1BM14CS003 Chandan
Student Table
USN C-ID
1BM14CS001 10
1BM14CS001 20
1BM14CS002 20
1BM14CS003 10
Student
Course Table
Student Enrolls_for
Course
USN
S-Name
C-ID
C-Name
Converting ER diagram to Tables
24 January 2024 CSE, BMSCE 91
Faculty Dependents_of
Dependent
Name
-----
Partial
Key
Weak
Entity
Owner
Entity Identifying
Relationship
F-ID F-Name
Converting ER diagram to Tables
 Weak Entity
24 January 2024 CSE, BMSCE 92
Faculty Dependents_of
Dependent
Name
-----
Partial
Key
Weak
Entity
Owner
Entity Identifying
Relationship
F-ID F-Name
F-ID F-Name
10 Dr. Guruprasad
20 Dr. Gowrishankar
Faculty Table
F-ID Dependent
Name
10 Ram
10 Ravi
20 Ram
Dependent Table
Activity To Do
Convert the Following ER diagram to Database table schema
24 January 2024 CSE, BMSCE 93
M
N
M
N
M
1
1
M
Database tables or Schema Diagram
Name Muscian-ID
24 January 2024 CSE, BMSCE 94
Musician Table
Album Table
Album-ID Copyright
Date
Format Title Producer
ID
Song Table
Song-ID Author Title Album-ID
Muscian-ID Song-ID
Performing Table
Muscian-ID Instr-ID
Plays Table
Instrument Table
Instr-ID Name M-Key
Database tables or Schema Diagram
Name Muscian-ID
24 January 2024 CSE, BMSCE 95
Musician Table
Album Table
Album-ID Copyright
Date
Format Title Producer
ID
Song Table
Song-ID Author Title Album-ID
Muscian-ID Song-ID
Performing Table
Muscian-ID Instr-ID
Plays Table
Instrument Table
Instr-ID Name M-Key
Thanks for Listening
24 January 2024 CSE, BMSCE 96
Cardinality Ratios
 Cardinality is a constraint on a relationship specifying the
number of entity instances that a specific entity may be related
to via the relationship.
Many to One:
More than one entities from entity set A can be associated with at
most one entity of entity set B, however an entity from entity set B
can be associated with more than one entity from entity set A.
24 January 2024 CSE, BMSCE 97
R Entity B
N
Entity A
1

More Related Content

Similar to Unit2-ER-Diagram-28-jfjkfkjddghjdghjg11-2022-11am.pptx

Bt0065, c programming and data structures
Bt0065, c programming and data structuresBt0065, c programming and data structures
Bt0065, c programming and data structuressmumbahelp
 
Database adminstrator L-4 Design a Database - Lo1.pptx
Database adminstrator L-4  Design a Database - Lo1.pptxDatabase adminstrator L-4  Design a Database - Lo1.pptx
Database adminstrator L-4 Design a Database - Lo1.pptxbirhanugirmay559
 
Introduction to database-ER Model
Introduction to database-ER ModelIntroduction to database-ER Model
Introduction to database-ER ModelAjit Nayak
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Modeloudesign
 
DBMS_unit2_Notes.pdf
DBMS_unit2_Notes.pdfDBMS_unit2_Notes.pdf
DBMS_unit2_Notes.pdfssuserf71896
 
U2_ER_modeling.pptx
U2_ER_modeling.pptxU2_ER_modeling.pptx
U2_ER_modeling.pptxssusera7b660
 
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...Fundamentals of database system  - Data Modeling Using the Entity-Relationshi...
Fundamentals of database system - Data Modeling Using the Entity-Relationshi...Mustafa Kamel Mohammadi
 
ch7.ppt ER Model lecture 102 slides set in ppt
ch7.ppt ER Model lecture 102 slides set in pptch7.ppt ER Model lecture 102 slides set in ppt
ch7.ppt ER Model lecture 102 slides set in pptFerdazdemir
 
Database Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and HashingDatabase Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and HashingPrabu U
 
Database Management System
Database Management System Database Management System
Database Management System FellowBuddy.com
 
Chapter-3 Data Modeling using ER Model
Chapter-3 Data Modeling using ER ModelChapter-3 Data Modeling using ER Model
Chapter-3 Data Modeling using ER ModelKunal Anand
 

Similar to Unit2-ER-Diagram-28-jfjkfkjddghjdghjg11-2022-11am.pptx (20)

DBMS Part-2.pptx
DBMS Part-2.pptxDBMS Part-2.pptx
DBMS Part-2.pptx
 
Data base lec3 (erd)
Data base lec3 (erd)Data base lec3 (erd)
Data base lec3 (erd)
 
Data modeling
Data modelingData modeling
Data modeling
 
Bt0065, c programming and data structures
Bt0065, c programming and data structuresBt0065, c programming and data structures
Bt0065, c programming and data structures
 
ch6.pptx
ch6.pptxch6.pptx
ch6.pptx
 
Data Models
Data ModelsData Models
Data Models
 
Database adminstrator L-4 Design a Database - Lo1.pptx
Database adminstrator L-4  Design a Database - Lo1.pptxDatabase adminstrator L-4  Design a Database - Lo1.pptx
Database adminstrator L-4 Design a Database - Lo1.pptx
 
Introduction to database-ER Model
Introduction to database-ER ModelIntroduction to database-ER Model
Introduction to database-ER Model
 
Week 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data ModelWeek 4 The Relational Data Model & The Entity Relationship Data Model
Week 4 The Relational Data Model & The Entity Relationship Data Model
 
DBMS_unit2_Notes.pdf
DBMS_unit2_Notes.pdfDBMS_unit2_Notes.pdf
DBMS_unit2_Notes.pdf
 
U2_ER_modeling.pptx
U2_ER_modeling.pptxU2_ER_modeling.pptx
U2_ER_modeling.pptx
 
Datamodels.pptx
Datamodels.pptxDatamodels.pptx
Datamodels.pptx
 
ER Model Ppt.ppt
ER Model Ppt.pptER Model Ppt.ppt
ER Model Ppt.ppt
 
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...
 
ch7.ppt ER Model lecture 102 slides set in ppt
ch7.ppt ER Model lecture 102 slides set in pptch7.ppt ER Model lecture 102 slides set in ppt
ch7.ppt ER Model lecture 102 slides set in ppt
 
Db lec 02_new
Db lec 02_newDb lec 02_new
Db lec 02_new
 
Database Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and HashingDatabase Design and the ER Model, Indexing and Hashing
Database Design and the ER Model, Indexing and Hashing
 
Database Management System
Database Management System Database Management System
Database Management System
 
Chapter-3 Data Modeling using ER Model
Chapter-3 Data Modeling using ER ModelChapter-3 Data Modeling using ER Model
Chapter-3 Data Modeling using ER Model
 
RDBMS_Unit 01
RDBMS_Unit 01RDBMS_Unit 01
RDBMS_Unit 01
 

Recently uploaded

Plasmid: types, structure and functions.
Plasmid: types, structure and functions.Plasmid: types, structure and functions.
Plasmid: types, structure and functions.Cherry
 
Concept of gene and Complementation test.pdf
Concept of gene and Complementation test.pdfConcept of gene and Complementation test.pdf
Concept of gene and Complementation test.pdfCherry
 
Pteris : features, anatomy, morphology and lifecycle
Pteris : features, anatomy, morphology and lifecyclePteris : features, anatomy, morphology and lifecycle
Pteris : features, anatomy, morphology and lifecycleCherry
 
CYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptxCYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptxCherry
 
Method of Quantifying interactions and its types
Method of Quantifying interactions and its typesMethod of Quantifying interactions and its types
Method of Quantifying interactions and its typesNISHIKANTKRISHAN
 
Reboulia: features, anatomy, morphology etc.
Reboulia: features, anatomy, morphology etc.Reboulia: features, anatomy, morphology etc.
Reboulia: features, anatomy, morphology etc.Cherry
 
Cyathodium bryophyte: morphology, anatomy, reproduction etc.
Cyathodium bryophyte: morphology, anatomy, reproduction etc.Cyathodium bryophyte: morphology, anatomy, reproduction etc.
Cyathodium bryophyte: morphology, anatomy, reproduction etc.Cherry
 
Lipids: types, structure and important functions.
Lipids: types, structure and important functions.Lipids: types, structure and important functions.
Lipids: types, structure and important functions.Cherry
 
EU START PROJECT. START-Newsletter_Issue_4.pdf
EU START PROJECT. START-Newsletter_Issue_4.pdfEU START PROJECT. START-Newsletter_Issue_4.pdf
EU START PROJECT. START-Newsletter_Issue_4.pdfStart Project
 
FS P2 COMBO MSTA LAST PUSH past exam papers.
FS P2 COMBO MSTA LAST PUSH past exam papers.FS P2 COMBO MSTA LAST PUSH past exam papers.
FS P2 COMBO MSTA LAST PUSH past exam papers.takadzanijustinmaime
 
Energy is the beat of life irrespective of the domains. ATP- the energy curre...
Energy is the beat of life irrespective of the domains. ATP- the energy curre...Energy is the beat of life irrespective of the domains. ATP- the energy curre...
Energy is the beat of life irrespective of the domains. ATP- the energy curre...Nistarini College, Purulia (W.B) India
 
Fourth quarter science 9-Kinetic-and-Potential-Energy.pptx
Fourth quarter science 9-Kinetic-and-Potential-Energy.pptxFourth quarter science 9-Kinetic-and-Potential-Energy.pptx
Fourth quarter science 9-Kinetic-and-Potential-Energy.pptxrosenapiri1
 
Human genetics..........................pptx
Human genetics..........................pptxHuman genetics..........................pptx
Human genetics..........................pptxCherry
 
The Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptxThe Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptxseri bangash
 
Precision Silviculture and Silviculture practices of bamboo.pptx
Precision Silviculture and Silviculture practices of bamboo.pptxPrecision Silviculture and Silviculture practices of bamboo.pptx
Precision Silviculture and Silviculture practices of bamboo.pptxNISHIKANTKRISHAN
 
Sequence submission tools ............pptx
Sequence submission tools ............pptxSequence submission tools ............pptx
Sequence submission tools ............pptxCherry
 
Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.Cherry
 
Genome sequencing,shotgun sequencing.pptx
Genome sequencing,shotgun sequencing.pptxGenome sequencing,shotgun sequencing.pptx
Genome sequencing,shotgun sequencing.pptxCherry
 
Cyanide resistant respiration pathway.pptx
Cyanide resistant respiration pathway.pptxCyanide resistant respiration pathway.pptx
Cyanide resistant respiration pathway.pptxCherry
 

Recently uploaded (20)

Plasmid: types, structure and functions.
Plasmid: types, structure and functions.Plasmid: types, structure and functions.
Plasmid: types, structure and functions.
 
Chemistry Data Delivery from the US-EPA Center for Computational Toxicology a...
Chemistry Data Delivery from the US-EPA Center for Computational Toxicology a...Chemistry Data Delivery from the US-EPA Center for Computational Toxicology a...
Chemistry Data Delivery from the US-EPA Center for Computational Toxicology a...
 
Concept of gene and Complementation test.pdf
Concept of gene and Complementation test.pdfConcept of gene and Complementation test.pdf
Concept of gene and Complementation test.pdf
 
Pteris : features, anatomy, morphology and lifecycle
Pteris : features, anatomy, morphology and lifecyclePteris : features, anatomy, morphology and lifecycle
Pteris : features, anatomy, morphology and lifecycle
 
CYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptxCYTOGENETIC MAP................ ppt.pptx
CYTOGENETIC MAP................ ppt.pptx
 
Method of Quantifying interactions and its types
Method of Quantifying interactions and its typesMethod of Quantifying interactions and its types
Method of Quantifying interactions and its types
 
Reboulia: features, anatomy, morphology etc.
Reboulia: features, anatomy, morphology etc.Reboulia: features, anatomy, morphology etc.
Reboulia: features, anatomy, morphology etc.
 
Cyathodium bryophyte: morphology, anatomy, reproduction etc.
Cyathodium bryophyte: morphology, anatomy, reproduction etc.Cyathodium bryophyte: morphology, anatomy, reproduction etc.
Cyathodium bryophyte: morphology, anatomy, reproduction etc.
 
Lipids: types, structure and important functions.
Lipids: types, structure and important functions.Lipids: types, structure and important functions.
Lipids: types, structure and important functions.
 
EU START PROJECT. START-Newsletter_Issue_4.pdf
EU START PROJECT. START-Newsletter_Issue_4.pdfEU START PROJECT. START-Newsletter_Issue_4.pdf
EU START PROJECT. START-Newsletter_Issue_4.pdf
 
FS P2 COMBO MSTA LAST PUSH past exam papers.
FS P2 COMBO MSTA LAST PUSH past exam papers.FS P2 COMBO MSTA LAST PUSH past exam papers.
FS P2 COMBO MSTA LAST PUSH past exam papers.
 
Energy is the beat of life irrespective of the domains. ATP- the energy curre...
Energy is the beat of life irrespective of the domains. ATP- the energy curre...Energy is the beat of life irrespective of the domains. ATP- the energy curre...
Energy is the beat of life irrespective of the domains. ATP- the energy curre...
 
Fourth quarter science 9-Kinetic-and-Potential-Energy.pptx
Fourth quarter science 9-Kinetic-and-Potential-Energy.pptxFourth quarter science 9-Kinetic-and-Potential-Energy.pptx
Fourth quarter science 9-Kinetic-and-Potential-Energy.pptx
 
Human genetics..........................pptx
Human genetics..........................pptxHuman genetics..........................pptx
Human genetics..........................pptx
 
The Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptxThe Mariana Trench remarkable geological features on Earth.pptx
The Mariana Trench remarkable geological features on Earth.pptx
 
Precision Silviculture and Silviculture practices of bamboo.pptx
Precision Silviculture and Silviculture practices of bamboo.pptxPrecision Silviculture and Silviculture practices of bamboo.pptx
Precision Silviculture and Silviculture practices of bamboo.pptx
 
Sequence submission tools ............pptx
Sequence submission tools ............pptxSequence submission tools ............pptx
Sequence submission tools ............pptx
 
Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.Selaginella: features, morphology ,anatomy and reproduction.
Selaginella: features, morphology ,anatomy and reproduction.
 
Genome sequencing,shotgun sequencing.pptx
Genome sequencing,shotgun sequencing.pptxGenome sequencing,shotgun sequencing.pptx
Genome sequencing,shotgun sequencing.pptx
 
Cyanide resistant respiration pathway.pptx
Cyanide resistant respiration pathway.pptxCyanide resistant respiration pathway.pptx
Cyanide resistant respiration pathway.pptx
 

Unit2-ER-Diagram-28-jfjkfkjddghjdghjg11-2022-11am.pptx

  • 1. Course – DBMS Course Instructor Dr. Umadevi V Department of CSE, BMSCE 24 January 2024 CSE, BMSCE 1
  • 2. Unit-2 Data Modelling using the Entity-Relationship(ER) model: Using High- Level conceptual Data Models for Database Design, A sample Database Application, Entity types, Entity Sets, Attributes and Keys, Relationship Types, Relationship Sets, Roles and Structural Constraints, Weak Entity types, Refining the ER Design, ER Diagrams, Relationship Types of Degree Higher than two, Relational Database Design using ER-to-Relational Mapping. Relational Algebra: Unary Relational Operations, SELECT and PROJECT, Relational Algebra Operations from Set Theory Binary Relational Operations: JOIN and DIVISION, Additional Relational Operations, Examples of Queries in Relational Algebra. 24 January 2024 CSE, BMSCE 2
  • 3. Unit-2 Data Modeling using the Entity-Relationship(ER) diagram - Entity Types, Entity Sets, Attributes and Keys 24 January 2024 CSE, BMSCE 3
  • 4. Sample Database Application  Example: HOD of CSE department calls you and asks to develop the following application “Develop a database application to automate the process of course registration”  Your first task should be to have a discussion with your client i.e., HOD, to identify the requirements of the application.  Requirements are as follows  Department has students and faculty  Department will offer a set of courses during each semester  Each student in the department during course registration will be opting for courses offered by the department  Faculty will be handling courses  Your second task should be to prepare a ER diagram which shows the Design plan of the database application to be developed. 24 January 2024 CSE, BMSCE 4
  • 5. Example: House design plan 24 January 2024 CSE, BMSCE 5 During plan preparation Various notations and Terminologies
  • 6. Design plan or ER diagram before actual development of the application 24 January 2024 CSE, BMSCE 6 Student USN Name Opting Courses Course Code Course Name Department Name Offers has Faculty ID Handles has Name
  • 7. Design plan or ER diagram before actual development of the application 24 January 2024 CSE, BMSCE 7 Requirements Were - Department has students and faculty - Department will offer a set of courses during each semester - Each student in the department during course registration will be opting for courses offered by the department - Faculty will be handling courses Entity Attribute Relationship
  • 8. Design plan or ER diagram before actual development of the application 24 January 2024 CSE, BMSCE 8 Requirements Were - Department has students and faculty - Department will offer a set of courses during each semester - Each student in the department during course registration will be opting for courses offered by the department - Faculty will be handling courses Constraints - Each semester student should register for minimum of 20 credits and maximum of 30 credits - Each faculty can handle a maximum two courses during each semester
  • 9. What is ER diagram ?  An Entity–Relationship model (ER model) describes the structure of a database with the help of a diagram, which is known as Entity Relationship Diagram (ER Diagram).  An ER model is a design or blueprint of a database that can later be implemented as a database.  It develops a conceptual design for the database. It also develops a very simple and easy to design view of data. 24 January 2024 CSE, BMSCE 9
  • 10. What is Entity, Entity Types, Entity sets ?  Entity is object in real world which has independent existence.  Example: Student, Course, Faculty, Car, House, College, Book, Food 24 January 2024 CSE, BMSCE 10 ER Diagram Notation for Entity: Rectangle Student Courses
  • 11. What is Entity Types, Entity sets ?  Entity type is collection of entities with common attributes  Entity set collection of one or more attributes 24 January 2024 CSE, BMSCE 11 USN Name Email ID Mobile No. DOB 1BM14CS001 Aditya aditya@bmsce.ac.in 9448444160 1-1-1997 1BM14CS002 Bharath bharath@bmsce.ac.in 8762244699 31-12-1996 Student Entity Type Entity Set
  • 12. What is Attribute ?  Attribute is a property that describes Entity. 24 January 2024 CSE, BMSCE 12 USN Name Email ID Mobile No. DOB 1BM14CS001 Aditya aditya@bmsce.ac.in 9448444160 1-1-1997 1BM14CS002 Bharath bharath@bmsce.ac.in 8762244699 31-12-1996 Student Entity Type Entity Set Attributes: USN, Name, Email ID, Mobile Number, DOB What is Domain ? Set of permitted values for an attribute.
  • 13. What is Attribute ?  Attribute is a property that describes Entity. 24 January 2024 CSE, BMSCE 13 USN Name Email ID Mobile No. DOB 1BM14CS001 Aditya aditya@bmsce.ac.in 9448444160 1-1-1997 1BM14CS002 Bharath bharath@bmsce.ac.in 8762244699 31-12-1996 Student Entity Type Entity Set Attributes: USN, Name, Email ID, Mobile Number, DOB ER Diagram Notation for Attribute: Ellipse Student USN Name Email ID Mobile No. DOB
  • 14. Activity - Questionnaire List attributes for 1. Car 2. Book 24 January 2024 CSE, BMSCE 14
  • 15. Example Few attributes of Car are Car_ID, Car_type, Car_color, Car_make… Few attributes of Book are Book_ID, Book_Title, Book_Publisher…. 24 January 2024 CSE, BMSCE 15
  • 16. Different categories of attributes  Simple (Atomic) vs Composite  Attributes that are not divisible are called Simple.  Attributes that can be divided into smaller parts are called Composite.  Ex.: Simple- USN, Composite- Name(First Name, Last Name), Address(Street name, Area Name, Place)  Single value vs Multiple valued  Ex.: Single – USN, Multiple – Mobile numbers  Stored vs Derived  Ex.: Stored – DOB, Derived – Age  Complex Attributes  Ex.: {Address(Street name, Area Name, Place)}  Office address and Residence Address  Null values  Ex. : Middle Name is Optional i.e. Gautham Sharma or Gautham K Sharma 24 January 2024 CSE, BMSCE 16
  • 17. Attribute: ER diagram notations 24 January 2024 CSE, BMSCE 17 Attribute ….. Composite Attribute Multivalued Attribute Derived Attribute
  • 18. What is Key ?  Key attribute is a attribute or a combination of attributes which will uniquely identify remaining attributes of entity. 24 January 2024 CSE, BMSCE 18 USN Name Email ID Mobile No. DOB 1BM14CS001 Aditya aditya@bmsce.ac.in 9448444160 1-1-1997 1BM14CS002 Bharath bharath@bmsce.ac.in 8762244699 31-12-1996 ER Diagram Notation for Entity: Rectangle USN
  • 19. Activity To DO 24 January 2024 CSE, BMSCE 19 Attribute ….. Composite Attribute Multivalued Attribute Derived Attribute Entity Key Attribute ______ Represent Employee entity using ER diagram notation Which has following attributes - Employee ID (Key) - Name - Address(House No., Street name, Area name, Place) - Mobile Number (Can have more than one ) - DOB - Age
  • 20. Next we will learn Unit 2: - Relationship Types, Relationship sets, Roles and Structural Constraints - Weak Entity Types 24 January 2024 CSE, BMSCE 20
  • 21. Relationship Type  A relationship type represents the association between entity types  Example, an Faculty works_for a department, a student enrolls_for in a course. Here, works_for and enrolls_for are called relationships. 24 January 2024 CSE, BMSCE 21 Faculty Works_for Department Student Enrolls_for Course relationship
  • 22. Relationship Type  A Relationship Type defines a relationship set among entities of certain entity types.  Example, an Faculty works_for a department, a student enrolls_for in a course. Here, works_for and enrolls_for are called relationships. 24 January 2024 CSE, BMSCE 22 Dr. Guruprasad Dr. Umadevi Dr. Indiramma Dr. Ashok CSE ISE Works_for relationship Faculty Entity Department Entity
  • 23. Relationship Type  A Relationship Type defines a relationship set among entities of certain entity types.  Example, an Faculty works_for a department, a student enrolls_for in a course. Here, works_for and enrolls are called relationships. 24 January 2024 CSE, BMSCE 23 Avinash Balaji Chandan Dinesh DBMS Java enrolls_for relationship Student Entity Course Entity
  • 24. Relationship Set  An Relationship Set is a collection of relationships all belonging to one relationship type. 24 January 2024 CSE, BMSCE 24 Avinash Balaji Chandan Dinesh DBMS Java enrolls_for relationship Student Entity Course Entity Here relationship set, has 4 relationships
  • 25. Relationship  The association among entities is called a relationship. or A Relationship is one instance in a Relationship Set. 24 January 2024 CSE, BMSCE 25 Avinash Balaji Chandan Dinesh DBMS Java enrolls_for relationship Student Entity Course Entity
  • 26. Relationship Degree  Binary Relationship: Degree two, two entities are participating 24 January 2024 CSE, BMSCE 26 Dr. Guruprasad Dr. Umadevi Dr. Indiramma Dr. Ashok CSE ISE Works_for relationship Faculty Entity Department Entity
  • 27. Relationship Degree  Ternary Relationship: Degree three, three entities are participating 24 January 2024 CSE, BMSCE 27 Micro Systems Pvt. Ltd UNIQ systems Pvt. Ltd Laptop Manufacturing Desktop Manufacturing supplies relationship Supplier Entity Project Entity Hard disk Keyboard Part Entity
  • 28. Relationship Degree  Ternary Relationship: Degree three, three entities are participating 24 January 2024 CSE, BMSCE 28 Micro Systems Pvt. Ltd UNIQ systems Pvt. Ltd Laptop Manufacturing Desktop Manufacturing supplies relationship Supplier Entity Project Entity Hard disk Keyboard Part Entity
  • 29. Recursive Relationship  In some cases the same entity type participates in more than once in a relationship type in different roles. 24 January 2024 CSE, BMSCE 29 Dr. Guruprasad Dr. Umadevi Dr. Indiramma supervision relationship Faculty Entity Supervisor Subordinate Subordinate
  • 30. Recursive Relationship  In some cases the same entity type participates in more than once in a relationship type in different roles. 24 January 2024 CSE, BMSCE 30 Dr. Guruprasad Dr. Umadevi Dr. Indiramma Principal supervision relationship Faculty Entity Supervisor Supervisor Subordinate
  • 31. ER Diagram Notations 24 January 2024 CSE, BMSCE 31 Attribute ….. Composite Attribute Multivalued Attribute Derived Attribute Entity Key Attribute ______ Relationship
  • 32. Relationship Constraints or Structural Constraints Two Types 1. Cardinality Ratios a. One to one (1:1) b. One to Many (1:M) c. Many to Many (N:M) 2. Participation Constraints a. Total b. Partial 24 January 2024 CSE, BMSCE 32
  • 33. Cardinality Ratios  Cardinality is a constraint on a relationship specifying the number of entity instances that a specific entity may be related to via the relationship. One to One: One entity from entity set A can be associated with at most one entity of entity set B and vice versa. 24 January 2024 CSE, BMSCE 33
  • 34. Cardinality Ratios  Cardinality is a constraint on a relationship specifying the number of entity instances that a specific entity may be related to via the relationship. One to One: One entity from entity set A can be associated with at most one entity of entity set B and vice versa. 24 January 2024 CSE, BMSCE 34 Dr. Guruprasad Dr. Gowrishankar CSE ISE Heads relationship Faculty Entity Department Entity
  • 35. Cardinality Ratios  Cardinality is a constraint on a relationship specifying the number of entity instances that a specific entity may be related to via the relationship. One to One: One instance of one entity type can participate in one instance of other entity type. 24 January 2024 CSE, BMSCE 35 Faculty Heads Department 1 1
  • 36. Cardinality Ratios  Cardinality is a constraint on a relationship specifying the number of entity instances that a specific entity may be related to via the relationship. One to Many: One entity from entity set A can be associated with more than one entities of entity set B however an entity from entity set B, can be associated with at most one entity. 24 January 2024 CSE, BMSCE 36 R Entity B 1 Entity A M
  • 37. Cardinality Ratios  Cardinality is a constraint on a relationship specifying the number of entity instances that a specific entity may be related to via the relationship. One to Many: One entity from entity set A can be associated with more than one entities of entity set B however an entity from entity set B, can be associated with at most one entity. 24 January 2024 CSE, BMSCE 37 Has Student 1 Departme nt M
  • 38. Cardinality Ratios  Cardinality is a constraint on a relationship specifying the number of entity instances that a specific entity may be related to via the relationship. Many to Many: One entity from A can be associated with more than one entity from B and vice versa. 24 January 2024 CSE, BMSCE 38 R Entity B N Entity A M
  • 39. Cardinality Ratios  Cardinality is a constraint on a relationship specifying the number of entity instances that a specific entity may be related to via the relationship. Many to Many: One entity from A can be associated with more than one entity from B and vice versa. 24 January 2024 CSE, BMSCE 39
  • 40. Cardinality Ratios  Cardinality is a constraint on a relationship specifying the number of entity instances that a specific entity may be related to via the relationship. Many to Many: One entity from A can be associated with more than one entity from B and vice versa. 24 January 2024 CSE, BMSCE 40
  • 41. Participation Constraint  Minimum number of relationship instance that each entity can participate in.  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. 24 January 2024 CSE, BMSCE 41
  • 42. Participation Constraint  Minimum number of relationship instance that each entity can participate in.  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. 24 January 2024 CSE, BMSCE 42
  • 43. Participation Constraint  Minimum number of relationship instance that each entity can participate in.  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. 24 January 2024 CSE, BMSCE 43
  • 44. Participation Constraint  Minimum number of relationship instance that each entity can participate in.  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. 24 January 2024 CSE, BMSCE 44 What is wrong in following relationship representation ?
  • 45. Participation Constraint  Minimum number of relationship instance that each entity can participate in.  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. 24 January 2024 CSE, BMSCE 45
  • 46. Weak Entity A weak entity set is one which does not have any primary key associated with it. A weak entity type normally has partial key which is the set of attributes that can uniquely identify weak entities that are related to same owner entity. The relationship that relates the weak entity type to an owner entity type is known as identifying relationship. The weak entity type always has total participation(existence dependency) in a relationship because the weak entity type can not be identified without an owner identity. 24 January 2024 CSE, BMSCE 46 Faculty Dependents_of Dependent Name ----- Partial Key Weak Entity Owner Entity Identifying Relationship
  • 47. Weak Entity  A weak entity set is one which does not have any primary key associated with it.  A weak entity type normally has partial key which is the set of attributes that can uniquely identify weak entities that are related to same owner entity. 24 January 2024 CSE, BMSCE 47 Dr. Sharma Dr. Reddy Ram Ravi Ram Dependents_of relationship Owner Entity Dependent (Children) Entity
  • 48. ER Diagram Symbols 24 January 2024 CSE, BMSCE 48 Attribute ….. Composite Attribute Multivalued Attribute Derived Attribute Entity Key Attribute ______ Weak Entity Partial Key _ _ _ _
  • 49. ER Diagram Symbols 24 January 2024 CSE, BMSCE 49 Relationship Identifying Relationship Total Participation of Entity A in R Cardinality Ratio 1:N for Entity A : B in R
  • 50. Topics Covered in Todays Class Unit 2: ER diagram design for a given requirements 24 January 2024 CSE, BMSCE 50
  • 51. Database Design Database design: Why do we need it ?  Agree on structure of the database before deciding on a particular implementation Consideration Issues such as:  What entities to model  How entities are related  What constraints exist in the domain  How to achieve good design ER diagram is a conceptual design of database 24 January 2024 CSE, BMSCE 51
  • 52. Database Design Process 24 January 2024 CSE, BMSCE 52 Requirement Analysis Conceptual Design Logical, Physical, Security etc., Requirement Analysis - What is going to be stored ? - How is it going to be used ? - What are we going to do with the data ? - Who should access the data ? Technical and Non-technical people are involved
  • 53. Database Design Process 24 January 2024 CSE, BMSCE 53 Requirement Analysis Conceptual Design Logical, Physical, Security etc., Conceptual Design - A high-level description of the database. - Sufficiently precise that technical people can understand it. - But, not so precise that non-technical can not participate. This is were Entity-Relationship (ER) Diagram fits in.
  • 54. Database Design Process 24 January 2024 CSE, BMSCE 54 Requirement Analysis Conceptual Design Logical, Physical, Security etc., ER diagram is visual syntax for DB design which is precise enough for technical points, but abstracted enough for non-technical people.
  • 55. Main phases of Database Design 24 January 2024 CSE, BMSCE 55
  • 56. Main phases of Database Design The first step shown is requirements collection and analysis. During this step, the database designers interview prospective database users to understand and document their data requirements. The next step is to create a conceptual schema for the database, using a high-level conceptual data model. This step is called conceptual design. The conceptual schema is a concise description of the data requirements of the users and includes detailed descriptions of the entity types, relationships, and constraints; these are expressed using the concepts provided by the high-level data model The next step in database design is the actual implementation of the database, using a commercial DBMS. This step is called logical design or data model mapping; its result is a database schema in the implementation data model of the DBMS. The last step is the physical design phase, during which the internal storage structures, file organizations, indexes, access paths, and physical design parameters for the database files are specified. In parallel with these activities, application programs are designed and implemented as database transactions corresponding to the high level transaction specifications. 24 January 2024 CSE, BMSCE 56
  • 57. ER Diagram Symbols 24 January 2024 CSE, BMSCE 57 Attribute ….. Composite Attribute Multivalued Attribute Derived Attribute Entity Key Attribute ______ Weak Entity Partial Key _ _ _ _
  • 58. ER Diagram Symbols 24 January 2024 CSE, BMSCE 58 Relationship Identifying Relationship Total Participation of Entity A in R Cardinality Ratio 1:N for Entity A : B in R
  • 59. Activity: ER diagram Decision: Relationship vs Empty Question 1: What does the following ER diagram say ? 24 January 2024 CSE, BMSCE 59
  • 60. Activity: ER diagram Decision: Relationship vs Empty Question 2: What does the following ER diagram say ? 24 January 2024 CSE, BMSCE 60
  • 61. Activity: ER diagram Decision: Relationship vs Empty Question 3: What does the following ER diagram say ? 24 January 2024 CSE, BMSCE 61
  • 62. Activity: ER diagram design Draw ER diagram for the following requirements Universal Records has decided to store information about musicians who perform on its albums (as well as other company data) in a database.  Each musician that records at Universal has an ID(Key) and name.  Each instrument used in songs recorded at Universal has a unique identification number (Key) , a name and a musical key.  Each album recorded on the Universal label has a unique identification number (Key) , a title, a copyright date and a format.  Each song recorded at Universal has a Song ID (Key), a title and an author.  Each musician may play several instruments, and a given instrument may be played by several musicians.  Each album has a number of songs on it, but no song may appear on more than one album.  Each song is performed by one or more musicians, and a musician may perform a number of songs.  Each album has exactly one musician who acts as its producer. A musician may produce several albums, of course. 24 January 2024 CSE, BMSCE 62
  • 63. Each musician that records at Universal has an ID (Key) and name. 24 January 2024 CSE, BMSCE 63
  • 64. Each instrument used in songs recorded at Universal has a unique identification number (Key) , a name and a musical key. 24 January 2024 CSE, BMSCE 64
  • 65. Each album recorded on the Universal label has a unique identification number (Key) , a title, a copyright date and a format. 24 January 2024 CSE, BMSCE 65
  • 66. Each song recorded at Universal has a Song ID (Key), a title and an author. 24 January 2024 CSE, BMSCE 66
  • 67. Each musician may play several instruments, and a given instrument may be played by several musicians. 24 January 2024 CSE, BMSCE 67 M N
  • 68. Each album has a number of songs on it, but no song may appear on more than one album. 24 January 2024 CSE, BMSCE 68 1 M
  • 69. Each song is performed by one or more musicians, and a musician may perform a number of songs. 24 January 2024 CSE, BMSCE 69 M N M N N 1
  • 70. Each album has exactly one musician who acts as its producer. A musician may produce several albums, of course 24 January 2024 CSE, BMSCE 70 M N M N M 1 1 M
  • 71. Next we will Learn Unit 2: - Converting ER Diagrams to Tables or Database design using ER-to-Relational Mapping 24 January 2024 CSE, BMSCE 71
  • 72. ER diagram  An ER diagram is a pictorial representation of the information that can be captured by a database. Such a “picture” serves two purposes:  It allows database professionals to describe an overall design concisely yet accurately.  (Most of) it can be easily transformed into the relational schema.  The ER diagram represents the conceptual level of database design meanwhile the relational schema (or database table) is the logical level for the database design. 24 January 2024 CSE, BMSCE 72
  • 73. Converting ER diagram to Tables  Entities and Simple Attributes  An entity type within ER diagram is turned into a table.  Each attribute turns into a column (attribute) in the table. The key attribute of the entity is the primary key of the table which is usually underlined. 24 January 2024 CSE, BMSCE 73 Student USN Name DOB USN Name DOB 1BM14CS001 Aditya 1-1-1997 1BM14CS002 Bharath 31-12-1996 Primary Key Student Table
  • 74. Converting ER diagram to Tables  Multi-Valued Attributes 24 January 2024 CSE, BMSCE 74 Student USN Name Mobile DOB
  • 75. Converting ER diagram to Tables  Multi-Valued Attributes 24 January 2024 CSE, BMSCE 75 Student USN Name Mobile DOB Which of the following representation of the table for Multivalued Attribute is best ? USN Name DOB Mobile 1 Mobile 2 1BM14CS001 Aditya 1-1-1997 8766655433 1BM14CS002 Bharath 31-12-1996 9762255433 7066722433 USN Mobile 1BM14CS001 8766655433 1BM14CS002 9762255433 1BM14CS002 7066722433 USN Name DOB 1BM14CS001 Aditya 1-1-1997 1BM14CS002 Bharath 31-12-1996 Student Table Mobile Table
  • 76. Converting ER diagram to Tables  Multi-Valued Attributes 24 January 2024 CSE, BMSCE 76 Student USN Name Mobile DOB USN Mobile 1BM14CS001 8766655433 1BM14CS002 9762255433 1BM14CS002 7066722433 USN Name DOB 1BM14CS001 Aditya 1-1-1997 1BM14CS002 Bharath 31-12-1996 Student Table Mobile Table If you have a multi-valued attribute, take the attribute and turn it into a new entity or table of its own. Then make a 1:N relationship between the new entity and the existing one. In simple words, 1. Create a table for the attribute. 2. Add the primary (id) column of the parent entity as a foreign key within the new table Primary Key Foreign Key
  • 77. Converting ER diagram to Tables  Composite Attribute 24 January 2024 CSE, BMSCE 77 Student USN Name Mobile DOB Address Street Name Area Name Place
  • 78. Converting ER diagram to Tables  Composite Attribute 24 January 2024 CSE, BMSCE 78 Student USN Name Mobile DOB Address Street Name Area Name Place USN Mobile 1BM14CS001 8766655433 1BM14CS002 9762255433 1BM14CS002 7066722433 USN Name DOB Street Area Place 1BM14CS001 Aditya 1-1-1997 RK Road Nagar Mandya 1BM14CS002 Bharath 31-7-1996 S V Road Layout Kolar Student Table Mobile Table
  • 79. Converting ER diagram to Tables  Derived Attribute 24 January 2024 CSE, BMSCE 79 Student USN Name Mobile DOB Address Street Name Area Name Place USN Mobile 1BM14CS001 8766655433 1BM14CS002 9762255433 1BM14CS002 7066722433 USN Name DOB Street Area Place 1BM14CS001 Aditya 1-1-1997 RK Road Nagar Mandya 1BM14CS002 Bharath 31-7-1996 S V Road Layout Kolar Student Table Mobile Table Age
  • 80. Converting ER diagram to Tables  Relationship: One-to-One 24 January 2024 CSE, BMSCE 80 1 1 F-ID F-Name D-ID D-Name
  • 81. Converting ER diagram to Tables  Relationship: One-to-One 24 January 2024 CSE, BMSCE 81 1 1 F-ID F-Name D-ID D-Name Approach 1: Foreign Key F-ID F-Name 1 Dr. H S Guruprasad 2 Dr. Umadevi V 3 Dr. Gowrishankar Faculty Table D- ID D-Name Heading F-ID 10 CSE 1 20 ISE 3 Department Table
  • 82. Converting ER diagram to Tables  Relationship: One-to-One 24 January 2024 CSE, BMSCE 82 1 1 F-ID F-Name D-ID D-Name Approach 1: Foreign Key F-ID F-Name 1 Dr. H S Guruprasad 2 Dr. Umadevi V 3 Dr. Gowrishankar Faculty Table D- ID D-Name Heading F-ID 10 CSE 1 20 ISE 3 Department Table Primary Key Foreign Key Primary Key
  • 83. Converting ER diagram to Tables  Relationship: One-to-One 24 January 2024 CSE, BMSCE 83 1 1 F-ID F-Name D-ID D-Name Approach 2: Merged Relation approach Merging two entity types and relationship into one single relation. This may be appropriate when both participations are total F- ID F-Name D-ID D-Name HOD 1 Dr. H S Guruprasad 10 CSE Yes 2 Dr. Umadevi V 10 CSE No 3 Dr. Gowrishankar 20 ISE Yes Faculty –Department Table
  • 84. Converting ER diagram to Tables  Relationship: One-to-One 24 January 2024 CSE, BMSCE 84 1 1 F-ID F-Name D-ID D-Name Approach 3: Cross-reference or relationship relation approach F-ID F-Name 1 Dr. H S Guruprasad 2 Dr. Umadevi V 3 Dr. Gowrishankar Faculty Table D- ID D-Name 10 CSE 20 ISE Department Table D-ID F-ID 10 1 20 3 HOD Table Lookup Table
  • 85. Converting ER diagram to Tables  Relationship: One-to-Many 24 January 2024 CSE, BMSCE 85 Has Student 1 Departme nt M D-ID D-Name USN S-Name
  • 86. Converting ER diagram to Tables  Relationship: One-to-Many 24 January 2024 CSE, BMSCE 86 Has Student 1 Departme nt M D-ID D-Name USN S-Name D-ID D-Name 10 CSE 20 ISE Department Table USN S-Name D-ID 1BM14CS001 Akash 10 1BM14CS002 Bharath 10 1BM14CS003 Ragu 10 1BM14CS004 Mohan 20 1BM14CS005 Nikil 20 Student Table Approach 1
  • 87. Converting ER diagram to Tables  Relationship: One-to-Many 24 January 2024 CSE, BMSCE 87 Has Student 1 Departme nt M D-ID D-Name USN S-Name D-ID D-Name 10 CSE 20 ISE Department Table USN S-Name 1BM14CS001 Akash 1BM14CS002 Bharath 1BM14CS003 Ragu 1BM14CS004 Mohan 1BM14CS005 Nikil Student Table USN D-ID 1BM14CS001 10 1BM14CS002 10 1BM14CS003 10 1BM14CS004 20 1BM14CS005 20 Department Student Table Approach 2
  • 88. Converting ER diagram to Tables  Relationship: Many-to-Many 24 January 2024 CSE, BMSCE 88 Student Enrolls_for Course USN S-Name C-ID C-Name
  • 89. Converting ER diagram to Tables  Relationship: Many-to-Many 24 January 2024 CSE, BMSCE 89 C-ID C-Name 10 DBMS 20 Java Course Table USN S-Name 1BM14CS001 Avinash 1BM14CS002 Balaji 1BM14CS003 Chandan Student Table USN C-ID 1BM14CS001 10 1BM14CS001 20 1BM14CS002 20 1BM14CS003 10 Student Course Table Student Enrolls_for Course USN S-Name C-ID C-Name
  • 90. Converting ER diagram to Tables  Relationship: Many-to-Many 24 January 2024 CSE, BMSCE 90 C-ID C-Name 10 DBMS 20 Java Course Table USN S-Name 1BM14CS001 Avinash 1BM14CS002 Balaji 1BM14CS003 Chandan Student Table USN C-ID 1BM14CS001 10 1BM14CS001 20 1BM14CS002 20 1BM14CS003 10 Student Course Table Student Enrolls_for Course USN S-Name C-ID C-Name
  • 91. Converting ER diagram to Tables 24 January 2024 CSE, BMSCE 91 Faculty Dependents_of Dependent Name ----- Partial Key Weak Entity Owner Entity Identifying Relationship F-ID F-Name
  • 92. Converting ER diagram to Tables  Weak Entity 24 January 2024 CSE, BMSCE 92 Faculty Dependents_of Dependent Name ----- Partial Key Weak Entity Owner Entity Identifying Relationship F-ID F-Name F-ID F-Name 10 Dr. Guruprasad 20 Dr. Gowrishankar Faculty Table F-ID Dependent Name 10 Ram 10 Ravi 20 Ram Dependent Table
  • 93. Activity To Do Convert the Following ER diagram to Database table schema 24 January 2024 CSE, BMSCE 93 M N M N M 1 1 M
  • 94. Database tables or Schema Diagram Name Muscian-ID 24 January 2024 CSE, BMSCE 94 Musician Table Album Table Album-ID Copyright Date Format Title Producer ID Song Table Song-ID Author Title Album-ID Muscian-ID Song-ID Performing Table Muscian-ID Instr-ID Plays Table Instrument Table Instr-ID Name M-Key
  • 95. Database tables or Schema Diagram Name Muscian-ID 24 January 2024 CSE, BMSCE 95 Musician Table Album Table Album-ID Copyright Date Format Title Producer ID Song Table Song-ID Author Title Album-ID Muscian-ID Song-ID Performing Table Muscian-ID Instr-ID Plays Table Instrument Table Instr-ID Name M-Key
  • 96. Thanks for Listening 24 January 2024 CSE, BMSCE 96
  • 97. Cardinality Ratios  Cardinality is a constraint on a relationship specifying the number of entity instances that a specific entity may be related to via the relationship. Many to One: More than one entities from entity set A can be associated with at most one entity of entity set B, however an entity from entity set B can be associated with more than one entity from entity set A. 24 January 2024 CSE, BMSCE 97 R Entity B N Entity A 1

Editor's Notes

  1. Address(Street name, Area Name, Place)
  2. Address(Street name, Area Name, Place)
  3. Address(Street name, Area Name, Place)