Database Management Systems
4Th SEMESTER
UNIT-1 CIC-210
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
1
Unit 1 Notes� Learning Objective
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
2
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
3
Introduction….
It is a software tool that manage the data.
DB+ DBMS= Database System
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
4
Need or Purpose
RDBMS and DBMS
In case of RDBMS data is to be stored in the form of Tables
In case of DMBS there data is stored in hierarchal form.
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
5
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
6
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
7
�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
8
Database Applications
A database application is a computer program whose primary purpose is entering and retrieving information from a computerized database. Early examples of database applications were accounting systems and airline reservations systems.���
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
9
�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
10
�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
11
DATA INDEPENDENCE IN DBMS
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
12
Data Independence�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
13
Diagram:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
14
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
15
Example:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
16
Logical DI
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
17
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
18
DBMS Architecture
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
19
DBMS Architecture�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
20
Continued….
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
21
2. Two tier architecture�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
22
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
23
3. Three tier architecture�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
24
Continued…
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
25
DBMS – Three level Architecture
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
26
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
27
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
28
2. Conceptual level�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
29
3. Internal level�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
30
View of Data in DBMS�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
31
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
32
Diagram Representation…..
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
33
�We have three levels of abstraction:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
34
Example:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
35
DBMS Schema
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
36
Diagram:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
37
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
38
DBMS Instance�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
39
Mapping:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
40
Conceptual/Internal Mapping:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
41
External/Conceptual Mapping:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
42
Database users and DBA
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
43
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
44
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
45
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
46
Database Administrator
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
47
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
48
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
49
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
50
Types of DBA
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
51
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
52
Entity Relationship Model
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
53
ER Diagram
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
54
ER Diagram
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
55
Explanation:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
56
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
57
����� Components of a ER Diagram�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
58
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
59
1 Entity�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
60
Weak Entity
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
61
2. Attribute
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
62
Key Attribute
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
63
Composite Attribute
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
64
Multivalued Attribute
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
65
Derived Attribute
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
66
Relationship
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
67
One to One Relationship�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
68
One to Many Relationship�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
69
Many to One Relationship�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
70
Many to Many Relationship�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
71
Key Concept in Dbms
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
72
Diagram
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
73
Types of Key
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
74
Primary Key
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
75
Diagram
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
76
Candidate Key
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
77
Diagram
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
78
Super Key
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
79
Foreign Key
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
80
Diagram
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
81
DBMS languages�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
82
Data Definition Language (DDL)�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
83
Data Manipulation Language (DML)�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
84
Data Control language (DCL)�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
85
Transaction Control Language(TCL)�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
86
Data models in DBMS�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
87
Data Model :
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
88
Relational model in DBMS�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
89
Table: Student
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
90
Table: Course
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
91
Explanation:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
92
Hierarchical model in DBMS�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
93
Diagram:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
94
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
95
Course Table:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
96
Constraints in DBMS�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
97
Types of constraints�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
98
NOT NULL
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
99
UNIQUE:�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
100
DEFAULT:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
101
CHECK:�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
102
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
103
Key constraints:�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
104
Design Issues in DBMS
Here are some of the issues that can occur while ER diagram design process:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
105
1. Choosing Entity Set vs Attributes�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
106
2. Choosing Entity Set vs. Relationship Sets
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
107
3. Choosing Binary vs n-ary Relationship Sets
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
108
4. Placing Relationship Attributes�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
109
DBMS – ER Diagram to Table Conversion
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
110
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
111
Diagram:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
112
2. Strong Entity Set With Composite Attributes�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
113
Diagram:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
114
3. Strong Entity Set With Multi Valued Attributes
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
115
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
116
4. Relationship Set to Table conversion
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
117
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
118
DBMS Generalization
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
119
The ER diagram before generalization looks like this:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
120
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
121
The ER diagram after generalization:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
122
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
123
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
124
DBMS Specialization�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
125
Specialization Example
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
126
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
127
DBMS Aggregation
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
128
Aggregation Example
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
129
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
130
E-R Model into Relational Model
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
131
1.Entity Set:�
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
132
Diagram:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
133
2.Entity set with multi valued attribute:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
134
Diagram:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
135
3.Entity set with Composite attribute:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
136
Diagram:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
137
4. 1:M (one to many) Relationship:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
138
Explanation:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
139
Diagram:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
140
5. M:1 (many to one) Relationship:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
141
Explanation:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
142
M:N (many to many) Relationship:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
143
Explanation:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
144
Diagram:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
145
7. 1:1 (one to one) Relationship:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
146
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
147
Diagram:
Department of Computer Science and Engineering , BVCOE New Delhi. Subject: DBMS , Instructor: Mrs. Nitasha Rathore
148