SlideShare a Scribd company logo
DBDA
(Database Design and Applications)
CH2
By: Prof. Ganesh Ingle
Session objective
Quick look of previous Session
EER Concepts and notations
Modelling class hierarchies
Tutorial 1: EER modelling
Relational model concepts
Relational data model constraints
Mapping ER Constructs to relations
DATA Association(ER Model)
 How an entity participate in a relationship???
 Total: If every entity in E participates in t=atleast one
relationship in R
Eg. Student elective subjects at least register for a course.
 Partial: Some entities in E participates in in
relationship R
Eg. Student and CR relation( not all the students are
participated for being CR)
Participation constraint
ER ASSIGNMENT
Draw an ER diagram with following constraint
Design a database for film
There are no actors in this database that have been in no movies.
b. There are some actors who have acted in more than ten movies.
c. Some actors have done a lead role in multiple movies.
d. A movie can have only a maximum of two lead actors.
e. Every director has been an actor in some movie.
f. No producer has ever been an actor.
g. A producer cannot be an actor in some other movie.
h. There are movies with more than a dozen actors.
i. Some producers have been a director as well.
j. Most movies have one director and one producer.
k. Some movies have one director but several producers.
l. There are some actors who have done a lead role, directed a movie,
and produced some movie.
m. No movie has a director who also acted in that movie.
ER ASSIGNMENT
ER ASSIGNMENT
EER features
 1)Generalization: Abstracting process of viewing sets
of objects as a single general class. Bottom up
approach.
 2) Specialization: Introducing new characteristics to
an existing class of objects to create new class .Top
down approach.
 3)Aggregation :Compiling information on an object
,thereby abstracting higher level object.
 Sub class
 Super class
 Inheritance and types WRT to DBMS
Specialization
Generalization
 ER diagram to set of Table conversion i.e. converting
ER model to relational data model .
 In relational data model we represent real model in to
collection of relations.
 Relation=table
 Domain???
 Tuple/record/row
 Attribute/column/
Relational model concepts
'Relational model concepts
Relational data model constraints Knowing all key
concepts
PRN SName PPNo Lisc-no DOB Fname
201519TW700
DHAYREEKAR
SOHAM
RAJENDRA
J8369854 AQ1254 14/02/1994 Rajendra
dhayrikar
201519TW721
SUTAR VISHAL
VIVEK
B8369859 AW2568 12/02/1994 Vivek sutar
201437tp101 Karneet
singh
H9369860 PQR1245 10/02/1994 Jaspreet singh
201537tp145 Sheetal Anil
Bhokare
Patil
M9369950 ABC143 18/12/1987 Anil Bhokare
Patil
 A key allows to identify a set of attributes to
distinguish entities from each other.
 Key attribute set KAS
 Key attribute KA
 Types of key:
 Superkey: Set of one or more attributes that allows
to identify an entity uniquely.(It may contain extra
attributes)eg. {Std_Id,Std_Name,Mobile_no,EmailId}
 Candidate key: It is minimal set of super key which
can uniquely identify an entity. eg. {Std_Id} not id
and name both.
 New definition: SK for which no subset is a superkey.
Relational data model constraints Key in
Relation
Relational data model constraints Key in
Relation
 Note : More than one CK is possible in relation
 Suppose we have 5 CK
 Primary key: vvimp
Chosen by DBA very important to identify the entity and the record. Eg.???
 Alternate Key/s:
CK-PK=AK ,5-1=4 . All 4 can become PK but not chosen by DBA.
 Secondary Key:
 Used for data retrieval. Eg.Emp_id(PK) ,Dept(Secondary key)
I want to find the employee wrt to dept then Dept is secondary key.
Many time in a Group by clause we use Secondary key.
 Foreign Key: PK of one related to another entity id FK
 Composite Key: Combination od two or more columns in a table that
uniquely identify the tuple/record/row.
Eg.CutomerId,OrderID,SalesDetail
Key in Relation
 Let R(A B C D) HOW MANY SUPER KEYS ARE POSSIBLE
PROVIDED CK=A
Key in Relation
 Let R(A B C D) HOW MANY SUPER KEYS ARE POSSIBLE
PROVIDED CK1=A,CK2=B
Key in Relation
 Let R(A B C D) HOW MANY SUPER KEYS ARE POSSIBLE
PROVIDED CK1=A,CK2=B,CK3=C
Key in Relation
 Let R(A1.A2,A3,……An) HOW MANY SUPER KEYS ARE
POSSIBLE PROVIDED
 With only CK A1= 2n-1
 With only CK A1,A2= 2n- 2n-1
 With only CK A1A2,A3A4= 2n-2+2n-2- 2n-4
 With only CK A1A2,A2A3=2n-1- 2n-3
THANK YOU

More Related Content

PDF
Database management system session 5
PDF
PPTX
Chapter 4
PPTX
Dbms ER Model
PDF
Dbms 7: ER Diagram Design Issue
PPT
3. Relational Models in DBMS
PPTX
ER DIAGRAM & ER MODELING IN DBMS
Database management system session 5
Chapter 4
Dbms ER Model
Dbms 7: ER Diagram Design Issue
3. Relational Models in DBMS
ER DIAGRAM & ER MODELING IN DBMS

What's hot (20)

PPTX
Fundamentals of database system - Relational data model and relational datab...
DOCX
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
PPTX
The relational data model part[1]
PDF
The Relational Data Model and Relational Database Constraints
PPTX
Database Design and Normalization Techniques
PPTX
Chapter 6 relational data model and relational
PDF
4 the relational data model and relational database constraints
PPTX
Relational database intro for marketers
PPTX
Chapter 6 relational data model and relational
PPTX
Cardinality and participation constraints
PPTX
Database - Entity Relationship Diagram (ERD)
PDF
Introduction to database-ER Model
PPTX
Entity Relationship Diagram
PPT
Er & eer to relational mapping
PPTX
Entity relation(1)
PPTX
Islamic University Previous Year Question Solution 2019 (ADBMS)
PDF
L7 er2
PDF
Chapter 2 Relational Data Model-part 2
PPTX
Relational model
PPT
Chapter3
Fundamentals of database system - Relational data model and relational datab...
The Relational Data Model and Relational Database Constraints Ch5 (Navathe 4t...
The relational data model part[1]
The Relational Data Model and Relational Database Constraints
Database Design and Normalization Techniques
Chapter 6 relational data model and relational
4 the relational data model and relational database constraints
Relational database intro for marketers
Chapter 6 relational data model and relational
Cardinality and participation constraints
Database - Entity Relationship Diagram (ERD)
Introduction to database-ER Model
Entity Relationship Diagram
Er & eer to relational mapping
Entity relation(1)
Islamic University Previous Year Question Solution 2019 (ADBMS)
L7 er2
Chapter 2 Relational Data Model-part 2
Relational model
Chapter3
Ad

Similar to DBMS CS2 (20)

PPTX
Data Models.pptx
PDF
Database Management System-session1-2
PPTX
ER MODEL.pptx
PPTX
Database management system power point presentation
PPTX
ER Modeling and Introduction to RDBMS
PPTX
Class 15_Introduction to Relational Algebra and Relational Calculus_19.11.202...
PPTX
rdbms3, dbms,dbms,rdbmssssssssssssssssssssssssssssssssss
PDF
Databases - Unit 2.pdf
PPTX
DATABASE DESIGN.pptx
PPTX
Module 2 dbms.pptx
PPTX
Unit 2 new.pptx for the actual dbms chad
PDF
Unit_2.pdf
PDF
Unit-2.pdf
PPTX
Database design
PPTX
Database design
PDF
Db lec 02_new
PDF
Unit 2 DBMS
PPT
18306_lec-2 (1).ppt
PPTX
ER diagram
PDF
ER diagram is created based on three principal components: entities, attribut...
Data Models.pptx
Database Management System-session1-2
ER MODEL.pptx
Database management system power point presentation
ER Modeling and Introduction to RDBMS
Class 15_Introduction to Relational Algebra and Relational Calculus_19.11.202...
rdbms3, dbms,dbms,rdbmssssssssssssssssssssssssssssssssss
Databases - Unit 2.pdf
DATABASE DESIGN.pptx
Module 2 dbms.pptx
Unit 2 new.pptx for the actual dbms chad
Unit_2.pdf
Unit-2.pdf
Database design
Database design
Db lec 02_new
Unit 2 DBMS
18306_lec-2 (1).ppt
ER diagram
ER diagram is created based on three principal components: entities, attribut...
Ad

More from Infinity Tech Solutions (20)

PDF
Database management system session 6
PDF
Database Management System-session 3-4-5
PDF
Main topic 3 problem solving and office automation
PDF
Introduction to c programming
PDF
PDF
Bds session 13 14
PDF
Computer memory, Types of programming languages
PDF
Basic hardware familiarization
PDF
User defined functions in matlab
PDF
Programming with matlab session 6
PDF
Programming with matlab session 3 notes
PPTX
AI/ML/DL/BCT A Revolution in Maritime Sector
PDF
Programming with matlab session 5 looping
PDF
BIG DATA Session 7 8
PDF
BIG DATA Session 6
PDF
Programming with matlab session 4
Database management system session 6
Database Management System-session 3-4-5
Main topic 3 problem solving and office automation
Introduction to c programming
Bds session 13 14
Computer memory, Types of programming languages
Basic hardware familiarization
User defined functions in matlab
Programming with matlab session 6
Programming with matlab session 3 notes
AI/ML/DL/BCT A Revolution in Maritime Sector
Programming with matlab session 5 looping
BIG DATA Session 7 8
BIG DATA Session 6
Programming with matlab session 4

Recently uploaded (20)

PPTX
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
PPTX
CH1 Production IntroductoryConcepts.pptx
PPTX
Lesson 3_Tessellation.pptx finite Mathematics
PPT
Mechanical Engineering MATERIALS Selection
PDF
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
DOCX
573137875-Attendance-Management-System-original
PPTX
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
PPTX
Construction Project Organization Group 2.pptx
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
web development for engineering and engineering
PPTX
Lecture Notes Electrical Wiring System Components
PDF
Digital Logic Computer Design lecture notes
PPTX
Strings in CPP - Strings in C++ are sequences of characters used to store and...
IOT PPTs Week 10 Lecture Material.pptx of NPTEL Smart Cities contd
bas. eng. economics group 4 presentation 1.pptx
CARTOGRAPHY AND GEOINFORMATION VISUALIZATION chapter1 NPTE (2).pptx
CH1 Production IntroductoryConcepts.pptx
Lesson 3_Tessellation.pptx finite Mathematics
Mechanical Engineering MATERIALS Selection
The CXO Playbook 2025 – Future-Ready Strategies for C-Suite Leaders Cerebrai...
573137875-Attendance-Management-System-original
MCN 401 KTU-2019-PPE KITS-MODULE 2.pptx
UNIT 4 Total Quality Management .pptx
Infosys Presentation by1.Riyan Bagwan 2.Samadhan Naiknavare 3.Gaurav Shinde 4...
Construction Project Organization Group 2.pptx
Operating System & Kernel Study Guide-1 - converted.pdf
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
M Tech Sem 1 Civil Engineering Environmental Sciences.pptx
Model Code of Practice - Construction Work - 21102022 .pdf
web development for engineering and engineering
Lecture Notes Electrical Wiring System Components
Digital Logic Computer Design lecture notes
Strings in CPP - Strings in C++ are sequences of characters used to store and...

DBMS CS2

  • 1. DBDA (Database Design and Applications) CH2 By: Prof. Ganesh Ingle
  • 2. Session objective Quick look of previous Session EER Concepts and notations Modelling class hierarchies Tutorial 1: EER modelling Relational model concepts Relational data model constraints Mapping ER Constructs to relations
  • 4.  How an entity participate in a relationship???  Total: If every entity in E participates in t=atleast one relationship in R Eg. Student elective subjects at least register for a course.  Partial: Some entities in E participates in in relationship R Eg. Student and CR relation( not all the students are participated for being CR) Participation constraint
  • 5. ER ASSIGNMENT Draw an ER diagram with following constraint Design a database for film There are no actors in this database that have been in no movies. b. There are some actors who have acted in more than ten movies. c. Some actors have done a lead role in multiple movies. d. A movie can have only a maximum of two lead actors. e. Every director has been an actor in some movie. f. No producer has ever been an actor. g. A producer cannot be an actor in some other movie. h. There are movies with more than a dozen actors. i. Some producers have been a director as well. j. Most movies have one director and one producer. k. Some movies have one director but several producers. l. There are some actors who have done a lead role, directed a movie, and produced some movie. m. No movie has a director who also acted in that movie.
  • 8. EER features  1)Generalization: Abstracting process of viewing sets of objects as a single general class. Bottom up approach.  2) Specialization: Introducing new characteristics to an existing class of objects to create new class .Top down approach.  3)Aggregation :Compiling information on an object ,thereby abstracting higher level object.  Sub class  Super class  Inheritance and types WRT to DBMS
  • 11.  ER diagram to set of Table conversion i.e. converting ER model to relational data model .  In relational data model we represent real model in to collection of relations.  Relation=table  Domain???  Tuple/record/row  Attribute/column/ Relational model concepts
  • 13. Relational data model constraints Knowing all key concepts PRN SName PPNo Lisc-no DOB Fname 201519TW700 DHAYREEKAR SOHAM RAJENDRA J8369854 AQ1254 14/02/1994 Rajendra dhayrikar 201519TW721 SUTAR VISHAL VIVEK B8369859 AW2568 12/02/1994 Vivek sutar 201437tp101 Karneet singh H9369860 PQR1245 10/02/1994 Jaspreet singh 201537tp145 Sheetal Anil Bhokare Patil M9369950 ABC143 18/12/1987 Anil Bhokare Patil
  • 14.  A key allows to identify a set of attributes to distinguish entities from each other.  Key attribute set KAS  Key attribute KA  Types of key:  Superkey: Set of one or more attributes that allows to identify an entity uniquely.(It may contain extra attributes)eg. {Std_Id,Std_Name,Mobile_no,EmailId}  Candidate key: It is minimal set of super key which can uniquely identify an entity. eg. {Std_Id} not id and name both.  New definition: SK for which no subset is a superkey. Relational data model constraints Key in Relation
  • 15. Relational data model constraints Key in Relation  Note : More than one CK is possible in relation  Suppose we have 5 CK  Primary key: vvimp Chosen by DBA very important to identify the entity and the record. Eg.???  Alternate Key/s: CK-PK=AK ,5-1=4 . All 4 can become PK but not chosen by DBA.  Secondary Key:  Used for data retrieval. Eg.Emp_id(PK) ,Dept(Secondary key) I want to find the employee wrt to dept then Dept is secondary key. Many time in a Group by clause we use Secondary key.  Foreign Key: PK of one related to another entity id FK  Composite Key: Combination od two or more columns in a table that uniquely identify the tuple/record/row. Eg.CutomerId,OrderID,SalesDetail
  • 16. Key in Relation  Let R(A B C D) HOW MANY SUPER KEYS ARE POSSIBLE PROVIDED CK=A
  • 17. Key in Relation  Let R(A B C D) HOW MANY SUPER KEYS ARE POSSIBLE PROVIDED CK1=A,CK2=B
  • 18. Key in Relation  Let R(A B C D) HOW MANY SUPER KEYS ARE POSSIBLE PROVIDED CK1=A,CK2=B,CK3=C
  • 19. Key in Relation  Let R(A1.A2,A3,……An) HOW MANY SUPER KEYS ARE POSSIBLE PROVIDED  With only CK A1= 2n-1  With only CK A1,A2= 2n- 2n-1  With only CK A1A2,A3A4= 2n-2+2n-2- 2n-4  With only CK A1A2,A2A3=2n-1- 2n-3