SlideShare a Scribd company logo
1 of 66
Download to read offline
Prof. Amit Vyas
Department of Computer Engineering
V.V.P. Engineering College
1
Teaching and Examination Scheme
Teaching Schemes
 Lecture (L) – 4 , Tutorial (T) – 0, Practical (P) - 2 = Credit – 5
 Total Marks of the Subject: 150
Examination Scheme
Theory Marks:
 ESE(E) – 70 (University Level Exam) (End Semester Examination)
 PA(M) – 30 (College Level Exam) (Progressive Assessment)
Practical Marks:
 ESE(V) – 30 (End Semester Examination (College level))
 PA(I) – 20 (Progressive Assessment (College Level))
2
Reference Books
1. “Database System Concepts”, 6th Edition by Abraham
Silberschatz, Henry F. Korth, S. Sudarshan, McGraw-Hill.
2. “Fundamentals of Database Systems”, 7th Edition by R.
Elmasri and S. Navathe, Pearson
3. “An introduction to Database Systems”, C J Date, Pearson.
3
Cont.…
4. “Modern Database Management”, Hoffer , Ramesh, Topi,
Pearson.
5. “Principles of Database and Knowledge – Base Systems”,
Vol 1 by J. D. Ullman, Computer Science Press.
6. “Understanding SQL”, Martin Gruber, BPB
7. SQL,PL/SQL – The Programing language of Oracle
4
List of Open Source learning website:
1. https://www.tutorialspoint.com/dbms/
2. https://www.w3schools.com/sql/
3. https://www.codecademy.com/learn/learn-sql
5
List of Experiments
1. To study DDL-create and DML-insert commands
2. Create table and insert sample data in tables.
3. Perform queries involving predicates LIKE, BETWEEN, IN etc.
4. To Perform various data manipulation commands, aggregate
functions and sorting concept on all created tables.
6
Cont.…
5.To study Single-row functions.
6.Displaying data from Multiple Tables (join)
7.To apply the concept of Aggregating Data using Group functions.
8. To solve queries using the concept of sub query.
7
Cont.…
9. To apply the concept of security and privileges
10. To study Transaction control commands
11. Write Cursor
12. Write Trigger
8
Course Outcomes (Learning Outcomes)
CO_1.-Identify the basic concepts and various data model used in
database design ER modeling concepts and architecture use and
design queries using SQL
CO_2.-Apply relational database theory and be able to describe
relational algebra expression, tuple and domain relation expression fro
queries.
9
Cont.…
CO_3.-Recognize and identify the use of normalization and functional
dependency, indexing and hashing technique used in database design.
CO_4.-Recognize/ identify the purpose of query processing and
optimization and also demonstrate the basic of query evaluation.
10
Cont.…
CO_5.-Apply and relate the concept of transaction,
concurrency control and recovery in database.
CO_6.-Discuss recovery system and be familiar with
introduction to web database, distribute databases, data
warehousing and mining.
11
DBMS Keys
12
Primary Key:
A primary key is used to ensure data in the specific column is unique.
It is a column cannot have NULL values. It is either an existing table
column or a column that is specifically generated by the database
according to a defined sequence.
 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).
13
14
Foreign Key:
A foreign key is a column or group of columns in a relational database
table that provides a link between data in two tables. It is a column (or
columns) that references a column (most often the primary key) of
another table.
Example:
STUD_NO in STUDENT_COURSE is a foreign key to STUD_NO in
STUDENT relation.
15
Stud no COURSE_NO COURSE_NAME
1 C1 DBMS
2 C2 DS
3 C3 PPS
4 C4 PPS
16
Sr.NO. PRIMARY KEY FOREIGN KEY
1
A primary key is used to ensure data in the specific
column is unique.
A foreign key is a column or group of columns in a
relational database table that provides a link
between data in two tables.
2
It uniquely identifies a record in the relational database
table.
It refers to the field in a table which is the primary
key of another table.
3 Only one primary key is allowed in a table.
Whereas more than one foreign key are allowed in
a table.
4
It is a combination of UNIQUE and Not Null
constraints.
It can contain duplicate values and a table in a
relational database.
5 It does not allow NULL values. It can also contain NULL values.
6 Its value cannot be deleted from the parent table. Its value can be deleted from the child table.
7
It constraint can be implicitly defined on the temporary
tables.
It constraint cannot be defined on the local or
global temporary tables.
17
Entity
 An entity is thing in real world with its own independent existence.
 E.g. book, Faculty
18
Entity Name
BOOK
Attributes
 Attribute is properties or details about an entity.
19
Attribute
Name
BOOK
Name
Author
BookNo
Relationship
Name
Relationship
 It should be placed between two entities and a line connecting it to an
entity.
20
Relationship
Name
Student Issue Book
Ternary Relationship
21
Faculty Student
Project
Guide
Relationship between 3 entities is called ternary
relationship.
Exercise
Draw an E-R diagram of Library Management System.
Draw an E-R diagram of Banking Management System.
22
23
24
Types of Attributes
25
26
27
28
Participation Constraints
�It specifies the participation of an entity set in a relationship set.
�There are two types participation constraints
 Total participation
 Partial participation
29
Partial participation
• some entities in the entity set may not
participate in any relationship in the
relationship set.
• indicated by single line
Total participation
• every entity in the entity set participates in at
least one relationship in the relationship set.
• indicated by double line
Weak Entity Set
 An entity set that does not have a primary key is called weak entity set.
 A weak entity is a type of entity which doesn't have its key attribute.
 ATM ID AND TRANS NO IS primary key payment.
30
Transactions
Strong
Entity Set
Weak Entity
Relationship
Weak Entity
Set
Trans No
.…………
31
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.
Superclass v/s Subclass
32
Super Class Sub Class
A superclass is an entity from which
another entities can be derived.
A subclass is an entity that is derived from
another entity.
E.g,
an entity account has two subsets
saving_account and current_account
So an account is superclass.
E.g,
saving_account and current_account
entities are derived from entity account.
So saving_account and current_account
are subclass.
33
Saving_Account Current_Account
Account
Super
Class
Sub
Class
Generalization v/s Specialization
34
DBMS Generalization
 Generalization is like a bottom-up approach in which two or
more entities of lower level combine to form a higher level
entity if they have some attributes in common.
 Generalization is more like subclass and superclass system, but the
only difference is the approach. Generalization uses the bottom-up
approach.
 In generalization, entities are combined to form a more generalized
entity, i.e., subclasses are combined to make a superclass
35
DBMS Generalization
For example, Faculty and Student entities can be
generalized and create a higher level entity Person.
36
DBMS Specialization
 Specialization is a top-down approach, and it is opposite
to Generalization. In specialization, one higher level
entity can be broken down into two lower level entities.
 Specialization is used to identify the subset of an entity set
that shares some distinguishing characteristics.
 Normally, the superclass is defined first, the subclass and
its related attributes are defined next, and relationship set
are then added
37
DBMS Specialization
For example: In an Employee management system,
EMPLOYEE entity can be specialized as TESTER or
DEVELOPER based on what role they play in the company.
38
DBMS Aggregation
In aggregation, the relation between two entities is treated
as a single entity. In aggregation, relationship with its
corresponding entities is aggregated into a higher level
entity.
39
 For example: Center entity offers the Course entity act as a
single entity in the relationship which is in a relationship
with another entity visitor. In the real world, if a visitor visits
a coaching center then he will never enquiry about the
Course only or just about the Center instead he will ask the
enquiry about both.
40
Generalization Specialization
The process of creation of
group from various entities is
called generalization.
The process of creation of sub-
groups within an entity is
called specialization.
It is Bottom-up approach. It is Top-down approach.
The process of taking the union
of two or more lower level
entity sets to produce a higher
level entity set.
The process of taking a sub set
of higher level entity set to
form a lower level entity set.
41
Generalization & Specialization example
42
Mapping Cardinality Constraints
 One to one
 One to many
 Many to one
 Many to many
43
44
One to one One to many
Mapping Cardinalities
Mapping Cardinalities
45
Many to one Many to Many
Reduction of ER diagram to Table
 There are some points for converting the ER diagram to the table:
 Entity type becomes a table.
 All single-valued attribute becomes a column for the table.
 A key attribute of the entity type represented by the primary key.
 The multivalued attribute is represented by a separate table.
 Composite attribute represented by components.
 Derived attributes are not considered in the table.
46
47
Reduction of ER diagram to Table
Entity type becomes a table.
 In the given ER diagram, LECTURE, STUDENT, SUBJECT and
COURSE forms individual tables.
All single-valued attribute becomes a column for the table.
 In the STUDENT entity, STUDENT_NAME and STUDENT_ID form
the column of STUDENT table. Similarly, COURSE_NAME and
COURSE_ID form the column of COURSE table and so on.
48
Reduction of ER diagram to Table
49
Reduction of ER diagram to Table
A key attribute of the entity type represented by the primary key.
 In the given ER diagram, COURSE_ID, STUDENT_ID, SUBJECT_ID,
and LECTURE_ID are the key attribute of the entity.
The multivalued attribute is represented by a separate table.
 In the student table, a hobby is a multivalued attribute. So it is not
possible to represent multiple values in a single column of STUDENT
table. Hence we create a table STUD_HOBBY with column name
STUDENT_ID and HOBBY. Using both the column, we create a
composite key.
50
Composite attribute represented by components.
 In the given ER diagram, student address is a composite attribute. It
contains CITY, PIN, DOOR#, STREET, and STATE. In the STUDENT
table, these attributes can merge as an individual column.
Derived attributes are not considered in the table.
 In the STUDENT table, Age is the derived attribute. It can be
calculated at any point of time by calculating the difference between
current date and Date of Birth.
51
1:1 Mapping Cardinality:
The primary key of any one table
in to the another table as a foreign
key.
52
1:N Mapping Cardinality:
primary key of table having
1 mapping in to the another
table having many cardinality
as a Foreign key.
53
N:N Mapping Cardinality:
54
55
Disjoint Constraint
It specifies that the entity of
a super class can belong
to only one lower-level
entity set (sub class).
56
Non-disjoint (Overlapping) Constraint
It specifies that an entity of a super
class can belong to more than
one lower-level entity set
(sub class).
57
Participation Constraints
�It specifies the participation of an entity set in a relationship set.
�There are two types participation constraints
 Total participation
 Partial (optional)participation
58
Partial participation
• some entities in the entity set may not
participate in any relationship in the
relationship set.
• indicated by single line
Total participation
• every entity in the entity set participates in at
least one relationship in the relationship set.
• indicated by double line
Type of Database Models
1. Hierarchical Model
2. Network Model
3. Entity-relationship Model
4. Relational Model
5. Object-oriented database Model
59
Hierarchical Model
60
Department
Teaching Staff
Non-Teaching
Staff
Full Time Part Time Admin Library
Network Model
�This is an extension of the hierarchical model, allowing many-to-
many relationships in a tree-like structure that allows multiple
parents.
61
Entity-relationship Model
62
Relational Model
Data is organized in two-dimensional tables and the relationship is
maintained by storing a common attribute. Also define some key relation
in table (EX. Customer and Bill)
63
Object-oriented database Model
Object oriented data model is based upon real world situations. These
situations are represented as objects, with different attributes. All
these object have multiple relationships between them.
64
Integrity Constraints
 Check
Limits the data values of variables to a specific set, range, or list
of values.
The constraint can be applied for a single column or a group of
columns.
E.g. value of SPI should be between 0 to 10.
 Not null
 Unique
 Primary key
 Foreign key
65
Thank You
66

More Related Content

Similar to Unit_2.pdf

Technical Note on DBMS
Technical Note on DBMSTechnical Note on DBMS
Technical Note on DBMSKr Shrishant
 
ICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdfICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdfInfotech27
 
DBMS interview questions
DBMS interview questionsDBMS interview questions
DBMS interview questionsHarish Gyanani
 
entity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptentity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptIRWANBINISMAILKPMGur1
 
Islamic University Previous Year Question Solution 2019 (ADBMS)
Islamic University Previous Year Question Solution 2019 (ADBMS)Islamic University Previous Year Question Solution 2019 (ADBMS)
Islamic University Previous Year Question Solution 2019 (ADBMS)Rakibul Hasan Pranto
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsKuntal Bhowmick
 
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptxdata base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptxmulukendemis44
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide sharefanta teferi
 
Data base management system(DBMS), sourav mathur
Data base management system(DBMS), sourav mathurData base management system(DBMS), sourav mathur
Data base management system(DBMS), sourav mathursourav mathur
 

Similar to Unit_2.pdf (20)

Technical Note on DBMS
Technical Note on DBMSTechnical Note on DBMS
Technical Note on DBMS
 
NMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.pptNMEC RD_UNIT 1.ppt
NMEC RD_UNIT 1.ppt
 
Dbms basic nots
Dbms basic notsDbms basic nots
Dbms basic nots
 
ICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdfICT DBA3 09 0710 Model Data Objects.pdf
ICT DBA3 09 0710 Model Data Objects.pdf
 
1resume
1resume1resume
1resume
 
DBMS interview questions
DBMS interview questionsDBMS interview questions
DBMS interview questions
 
entity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.pptentity-relationship-diagram-chen-&-crow -model.ppt
entity-relationship-diagram-chen-&-crow -model.ppt
 
Islamic University Previous Year Question Solution 2019 (ADBMS)
Islamic University Previous Year Question Solution 2019 (ADBMS)Islamic University Previous Year Question Solution 2019 (ADBMS)
Islamic University Previous Year Question Solution 2019 (ADBMS)
 
database
databasedatabase
database
 
Rdbms concepts
Rdbms conceptsRdbms concepts
Rdbms concepts
 
SW SEC 1.pptx
SW SEC 1.pptxSW SEC 1.pptx
SW SEC 1.pptx
 
DBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental conceptsDBMS and Rdbms fundamental concepts
DBMS and Rdbms fundamental concepts
 
unit-3_Chapter1_RDRA.pdf
unit-3_Chapter1_RDRA.pdfunit-3_Chapter1_RDRA.pdf
unit-3_Chapter1_RDRA.pdf
 
L7 er2
L7 er2L7 er2
L7 er2
 
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptxdata base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
data base u2 dfhjhdbgjhbfxjjkgfbjkg.pptx
 
Download different material from slide share
Download different material from slide shareDownload different material from slide share
Download different material from slide share
 
Data base management system(DBMS), sourav mathur
Data base management system(DBMS), sourav mathurData base management system(DBMS), sourav mathur
Data base management system(DBMS), sourav mathur
 
ERD(2).ppt
ERD(2).pptERD(2).ppt
ERD(2).ppt
 
Db lec 01
Db lec 01Db lec 01
Db lec 01
 
Bt0066 dbms
Bt0066 dbmsBt0066 dbms
Bt0066 dbms
 

Recently uploaded

IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...RajaP95
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130Suhani Kapoor
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations120cr0395
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...ranjana rawat
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)Suman Mia
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )Tsuyoshi Horigome
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxpranjaldaimarysona
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Dr.Costas Sachpazis
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130Suhani Kapoor
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...Soham Mondal
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 

Recently uploaded (20)

IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
IMPLICATIONS OF THE ABOVE HOLISTIC UNDERSTANDING OF HARMONY ON PROFESSIONAL E...
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
VIP Call Girls Service Hitech City Hyderabad Call +91-8250192130
 
Extrusion Processes and Their Limitations
Extrusion Processes and Their LimitationsExtrusion Processes and Their Limitations
Extrusion Processes and Their Limitations
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur EscortsCall Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
Call Girls Service Nagpur Tanvi Call 7001035870 Meet With Nagpur Escorts
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
The Most Attractive Pune Call Girls Budhwar Peth 8250192130 Will You Miss Thi...
 
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)Software Development Life Cycle By  Team Orange (Dept. of Pharmacy)
Software Development Life Cycle By Team Orange (Dept. of Pharmacy)
 
SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )SPICE PARK APR2024 ( 6,793 SPICE Models )
SPICE PARK APR2024 ( 6,793 SPICE Models )
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINEDJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
DJARUM4D - SLOT GACOR ONLINE | SLOT DEMO ONLINE
 
Processing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptxProcessing & Properties of Floor and Wall Tiles.pptx
Processing & Properties of Floor and Wall Tiles.pptx
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
Sheet Pile Wall Design and Construction: A Practical Guide for Civil Engineer...
 
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
VIP Call Girls Service Kondapur Hyderabad Call +91-8250192130
 
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
OSVC_Meta-Data based Simulation Automation to overcome Verification Challenge...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Meera Call 7001035870 Meet With Nagpur Escorts
 

Unit_2.pdf

  • 1. Prof. Amit Vyas Department of Computer Engineering V.V.P. Engineering College 1
  • 2. Teaching and Examination Scheme Teaching Schemes  Lecture (L) – 4 , Tutorial (T) – 0, Practical (P) - 2 = Credit – 5  Total Marks of the Subject: 150 Examination Scheme Theory Marks:  ESE(E) – 70 (University Level Exam) (End Semester Examination)  PA(M) – 30 (College Level Exam) (Progressive Assessment) Practical Marks:  ESE(V) – 30 (End Semester Examination (College level))  PA(I) – 20 (Progressive Assessment (College Level)) 2
  • 3. Reference Books 1. “Database System Concepts”, 6th Edition by Abraham Silberschatz, Henry F. Korth, S. Sudarshan, McGraw-Hill. 2. “Fundamentals of Database Systems”, 7th Edition by R. Elmasri and S. Navathe, Pearson 3. “An introduction to Database Systems”, C J Date, Pearson. 3
  • 4. Cont.… 4. “Modern Database Management”, Hoffer , Ramesh, Topi, Pearson. 5. “Principles of Database and Knowledge – Base Systems”, Vol 1 by J. D. Ullman, Computer Science Press. 6. “Understanding SQL”, Martin Gruber, BPB 7. SQL,PL/SQL – The Programing language of Oracle 4
  • 5. List of Open Source learning website: 1. https://www.tutorialspoint.com/dbms/ 2. https://www.w3schools.com/sql/ 3. https://www.codecademy.com/learn/learn-sql 5
  • 6. List of Experiments 1. To study DDL-create and DML-insert commands 2. Create table and insert sample data in tables. 3. Perform queries involving predicates LIKE, BETWEEN, IN etc. 4. To Perform various data manipulation commands, aggregate functions and sorting concept on all created tables. 6
  • 7. Cont.… 5.To study Single-row functions. 6.Displaying data from Multiple Tables (join) 7.To apply the concept of Aggregating Data using Group functions. 8. To solve queries using the concept of sub query. 7
  • 8. Cont.… 9. To apply the concept of security and privileges 10. To study Transaction control commands 11. Write Cursor 12. Write Trigger 8
  • 9. Course Outcomes (Learning Outcomes) CO_1.-Identify the basic concepts and various data model used in database design ER modeling concepts and architecture use and design queries using SQL CO_2.-Apply relational database theory and be able to describe relational algebra expression, tuple and domain relation expression fro queries. 9
  • 10. Cont.… CO_3.-Recognize and identify the use of normalization and functional dependency, indexing and hashing technique used in database design. CO_4.-Recognize/ identify the purpose of query processing and optimization and also demonstrate the basic of query evaluation. 10
  • 11. Cont.… CO_5.-Apply and relate the concept of transaction, concurrency control and recovery in database. CO_6.-Discuss recovery system and be familiar with introduction to web database, distribute databases, data warehousing and mining. 11
  • 13. Primary Key: A primary key is used to ensure data in the specific column is unique. It is a column cannot have NULL values. It is either an existing table column or a column that is specifically generated by the database according to a defined sequence.  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). 13
  • 14. 14
  • 15. Foreign Key: A foreign key is a column or group of columns in a relational database table that provides a link between data in two tables. It is a column (or columns) that references a column (most often the primary key) of another table. Example: STUD_NO in STUDENT_COURSE is a foreign key to STUD_NO in STUDENT relation. 15
  • 16. Stud no COURSE_NO COURSE_NAME 1 C1 DBMS 2 C2 DS 3 C3 PPS 4 C4 PPS 16
  • 17. Sr.NO. PRIMARY KEY FOREIGN KEY 1 A primary key is used to ensure data in the specific column is unique. A foreign key is a column or group of columns in a relational database table that provides a link between data in two tables. 2 It uniquely identifies a record in the relational database table. It refers to the field in a table which is the primary key of another table. 3 Only one primary key is allowed in a table. Whereas more than one foreign key are allowed in a table. 4 It is a combination of UNIQUE and Not Null constraints. It can contain duplicate values and a table in a relational database. 5 It does not allow NULL values. It can also contain NULL values. 6 Its value cannot be deleted from the parent table. Its value can be deleted from the child table. 7 It constraint can be implicitly defined on the temporary tables. It constraint cannot be defined on the local or global temporary tables. 17
  • 18. Entity  An entity is thing in real world with its own independent existence.  E.g. book, Faculty 18 Entity Name BOOK
  • 19. Attributes  Attribute is properties or details about an entity. 19 Attribute Name BOOK Name Author BookNo Relationship Name
  • 20. Relationship  It should be placed between two entities and a line connecting it to an entity. 20 Relationship Name Student Issue Book
  • 21. Ternary Relationship 21 Faculty Student Project Guide Relationship between 3 entities is called ternary relationship.
  • 22. Exercise Draw an E-R diagram of Library Management System. Draw an E-R diagram of Banking Management System. 22
  • 23. 23
  • 24. 24
  • 26. 26
  • 27. 27
  • 28. 28
  • 29. Participation Constraints �It specifies the participation of an entity set in a relationship set. �There are two types participation constraints  Total participation  Partial participation 29 Partial participation • some entities in the entity set may not participate in any relationship in the relationship set. • indicated by single line Total participation • every entity in the entity set participates in at least one relationship in the relationship set. • indicated by double line
  • 30. Weak Entity Set  An entity set that does not have a primary key is called weak entity set.  A weak entity is a type of entity which doesn't have its key attribute.  ATM ID AND TRANS NO IS primary key payment. 30 Transactions Strong Entity Set Weak Entity Relationship Weak Entity Set Trans No .…………
  • 31. 31 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.
  • 33. Super Class Sub Class A superclass is an entity from which another entities can be derived. A subclass is an entity that is derived from another entity. E.g, an entity account has two subsets saving_account and current_account So an account is superclass. E.g, saving_account and current_account entities are derived from entity account. So saving_account and current_account are subclass. 33 Saving_Account Current_Account Account Super Class Sub Class
  • 35. DBMS Generalization  Generalization is like a bottom-up approach in which two or more entities of lower level combine to form a higher level entity if they have some attributes in common.  Generalization is more like subclass and superclass system, but the only difference is the approach. Generalization uses the bottom-up approach.  In generalization, entities are combined to form a more generalized entity, i.e., subclasses are combined to make a superclass 35
  • 36. DBMS Generalization For example, Faculty and Student entities can be generalized and create a higher level entity Person. 36
  • 37. DBMS Specialization  Specialization is a top-down approach, and it is opposite to Generalization. In specialization, one higher level entity can be broken down into two lower level entities.  Specialization is used to identify the subset of an entity set that shares some distinguishing characteristics.  Normally, the superclass is defined first, the subclass and its related attributes are defined next, and relationship set are then added 37
  • 38. DBMS Specialization For example: In an Employee management system, EMPLOYEE entity can be specialized as TESTER or DEVELOPER based on what role they play in the company. 38
  • 39. DBMS Aggregation In aggregation, the relation between two entities is treated as a single entity. In aggregation, relationship with its corresponding entities is aggregated into a higher level entity. 39
  • 40.  For example: Center entity offers the Course entity act as a single entity in the relationship which is in a relationship with another entity visitor. In the real world, if a visitor visits a coaching center then he will never enquiry about the Course only or just about the Center instead he will ask the enquiry about both. 40
  • 41. Generalization Specialization The process of creation of group from various entities is called generalization. The process of creation of sub- groups within an entity is called specialization. It is Bottom-up approach. It is Top-down approach. The process of taking the union of two or more lower level entity sets to produce a higher level entity set. The process of taking a sub set of higher level entity set to form a lower level entity set. 41
  • 43. Mapping Cardinality Constraints  One to one  One to many  Many to one  Many to many 43
  • 44. 44 One to one One to many Mapping Cardinalities
  • 46. Reduction of ER diagram to Table  There are some points for converting the ER diagram to the table:  Entity type becomes a table.  All single-valued attribute becomes a column for the table.  A key attribute of the entity type represented by the primary key.  The multivalued attribute is represented by a separate table.  Composite attribute represented by components.  Derived attributes are not considered in the table. 46
  • 47. 47
  • 48. Reduction of ER diagram to Table Entity type becomes a table.  In the given ER diagram, LECTURE, STUDENT, SUBJECT and COURSE forms individual tables. All single-valued attribute becomes a column for the table.  In the STUDENT entity, STUDENT_NAME and STUDENT_ID form the column of STUDENT table. Similarly, COURSE_NAME and COURSE_ID form the column of COURSE table and so on. 48
  • 49. Reduction of ER diagram to Table 49
  • 50. Reduction of ER diagram to Table A key attribute of the entity type represented by the primary key.  In the given ER diagram, COURSE_ID, STUDENT_ID, SUBJECT_ID, and LECTURE_ID are the key attribute of the entity. The multivalued attribute is represented by a separate table.  In the student table, a hobby is a multivalued attribute. So it is not possible to represent multiple values in a single column of STUDENT table. Hence we create a table STUD_HOBBY with column name STUDENT_ID and HOBBY. Using both the column, we create a composite key. 50
  • 51. Composite attribute represented by components.  In the given ER diagram, student address is a composite attribute. It contains CITY, PIN, DOOR#, STREET, and STATE. In the STUDENT table, these attributes can merge as an individual column. Derived attributes are not considered in the table.  In the STUDENT table, Age is the derived attribute. It can be calculated at any point of time by calculating the difference between current date and Date of Birth. 51
  • 52. 1:1 Mapping Cardinality: The primary key of any one table in to the another table as a foreign key. 52
  • 53. 1:N Mapping Cardinality: primary key of table having 1 mapping in to the another table having many cardinality as a Foreign key. 53
  • 55. 55
  • 56. Disjoint Constraint It specifies that the entity of a super class can belong to only one lower-level entity set (sub class). 56
  • 57. Non-disjoint (Overlapping) Constraint It specifies that an entity of a super class can belong to more than one lower-level entity set (sub class). 57
  • 58. Participation Constraints �It specifies the participation of an entity set in a relationship set. �There are two types participation constraints  Total participation  Partial (optional)participation 58 Partial participation • some entities in the entity set may not participate in any relationship in the relationship set. • indicated by single line Total participation • every entity in the entity set participates in at least one relationship in the relationship set. • indicated by double line
  • 59. Type of Database Models 1. Hierarchical Model 2. Network Model 3. Entity-relationship Model 4. Relational Model 5. Object-oriented database Model 59
  • 61. Network Model �This is an extension of the hierarchical model, allowing many-to- many relationships in a tree-like structure that allows multiple parents. 61
  • 63. Relational Model Data is organized in two-dimensional tables and the relationship is maintained by storing a common attribute. Also define some key relation in table (EX. Customer and Bill) 63
  • 64. Object-oriented database Model Object oriented data model is based upon real world situations. These situations are represented as objects, with different attributes. All these object have multiple relationships between them. 64
  • 65. Integrity Constraints  Check Limits the data values of variables to a specific set, range, or list of values. The constraint can be applied for a single column or a group of columns. E.g. value of SPI should be between 0 to 10.  Not null  Unique  Primary key  Foreign key 65