DBMS (Unit - 1)
DBMS (Unit - 1)
1
PA RT · 1
vs File System,
01•1•ruicu-. Oo!ribo~c System
P.m Conrept and Architecture.
IJfllrilmse Sy!il
UN IT Introduction
Qu esti ons -An swe rs
ons
dium Ans wer Typ e Qu esti
Long An swe r Type and Me
An aw er
Adv ant age s of DBMS: ncy because it stores
y: It controls data redunda
I. Dat aba se red und anc e file and that recorded data is placed
le data bas
all the data in one sing
in the database.
1-1 A (CS'IT-Sem-5)
M~mrnt Sy1:trm 1-:J A (('~I'
. . - r-s,,111. Introduction
S. Data sharing: In DBM:--. thr ant hon :zt•d ll ~«' rn of nn or ·1 1. ~I t--4 A rC8'f'l '.Scm -f,/
cdat.1 aroo11g cnulupl1• u~1•rs. g, " 1.n11on
arr . • • 1·11n
:1. H1wci11 li.r,·d u11cr.11:
• ........ maintA'll&)K"e: It l'.all he t•,\S1ly mamtnmahlc clup t 0 th (' (·
.. -.., • Tlwrw :or1• 111 ,, soph1sti,·11ti: d users, but they write special database
f thf' daaba.cc s,• stem. l'ntr11 J1l.1. •cJ 11
l 11pplic1,I 1r1n r,rr1gr11m.'I.
'
• R.d~ timfl: It rrou<'t's d1•, <'lopnwnt I ime and mai t
n <ma ne h. Th"Y nr,• thf; rl1?Vcl<Jfl'"" who develop th!. complex programs
l Ba<'kuP: It pro, 1dec b.'.lrkup nnd recovery subsy s tems w· . e neud a<:corrhng to th11 rr,quirement.
1
r harlup of data from hardware and software f: ~lch creatt•
rt !'l"!' the data 1frequiN'd ailures and 4. Standalon e u ser s :
a. These usus will ha-,c standalone database for their personal use.
, Maltiple ~r interfa(.'t': It provides different types of .
e5_ft._.,.., -r 1· . user inte r b. These kinds of database will have predefined database packages
,..,........ userinte.uace, app 1cation program interface r,ace8 whi ch wiJl h.ive menus and graphical interfaces.
Di_.nata•urDBMS: .
5. Netive users:
L C- ftl hardware and software : It requires high a. These are the users who Ubf the existing application to interact
Jrl!CHIOr and large memory size to run DBMS softwar:.peed of data
with t he database.
l. Siw : It occupies a large space of disks and large b. For example, online library system, ticket booking systems. ATMs
effiom . memory to run
etc.
l c:..,leuty : Database system creates additional c .
ttqUll'l'IDeDt.s. om P1eXI ty and Que 1.4. ] Who are data administrators ? What are t he functions
t Riper impact offailure: Failure is highly impacted th of database administrator ?
brclUse m m~ of the organization, all the data stored : database OR
databaae and if the database is damaged due to electricm ~ smgle Discuss the role of database administrator.
,-AKTU--2-0-17--1-8-,M_ar_k_!_IO-,J
-What
tialaR corruption then the data may be Jost forever. failure or
-
~~
~
~ are .
do you understand by database users ? Des 'b
eftllt types of database users
Dl&al..t types
11R1'1 are the one who use
of uaera de n . an
pe ding on
•
.
~e
ii. in
The physical level d
re .
·be
of database. database.
-----
escn s the complex low-le\ el data
1
details. structures
Qae 1.7. IExplain the difference between database management
Lotical level : system (DBMS) and file system.
IA,IP·ca1 level is the next-h;~h
what data are sto d . 'Ufl er level ofabstraction and it descnhec
among those data.re m the database • an d w h at relationship exists
Auwvl
JPl)e&ptem
S.No. DBMS
ii. The logical level thus des . .
8. smallnumberofrelativel c~bes the entire database in termsofa
View level: Y mm pie structures. 1. In DBMS, the user is not In thi11 sy11tem, the u11Cr has to
write the procedun:s for managing
required to write the
procedures. th(: file.
l View level is the . st
0fthe entire da•-~e level of abstraction: it describes onJy part
i. '1\e . -..-e. 2. DBMS gives an abstract view File system provide11 the detail of
with ~w level of ahstraction ensts
. . of data that hides the details. the data representation and
WJe 8Yltem to simplifr their interactJon storage of data .
ii. 'nit . .
87ltem may Pl'Ovide many Views
.
for the same database-
... " l\lan·wt'IIH'nl
l)al:1,~1s, ' •,. th~I
. l'lll
1-7 A (C&J , ,
1 Introduction
,I Tnn~ pn,~ck~ . a . rrn~h ~'il1• syst<•m do notJ
•
- "'~llJ'ii)
1uvl, u
c;H/l'f.Hi•m· 6>
1. 11.AI'
- ~ -
.
· lik
' J,thefunctional1t1es e
l'fY Jl\('C'hi\tll~tll, ~ ,(llll't' I1unis111 1 1, •f h
1
f ft'('(l\
ter •
Cru,1i
• ' I L l' B .
dat:1 lrom erasIlt's while' l'n YR(pli\
:I
• rcR r,ns1hk lo provi< c
The• Rcrvt• r R1cJr• JR ~nn.,11ction managr,menl. .
-f:h,•s)~t,•m failure . 80 qul'ry pron" ~1ng nnd h..' fJHMS, ch1•nt-sidc application establJ.Shcs
1 then the cont<'ut 0~~ 0\cd111n, n1cull• with t C .
lost. le file WilJ 4 'fn cnnunu. 1th the Bl'fVCf udr
II C(lllnl'CtJOn W
r -:;-. l)ll'.\IS provides_ a good l ~ o · .. ------ 1
j pn,r,'t'tion m<'Chamsm. · Protect fi
undl'r the file system. a ilc Serve r
DDtabaRc HyHtt-m
~ 5. DBMS ~m dlkit•nt!y store and Fi.le system cannot effi ·
rl'lri!'H' th<' data. and retrieve the datactentJy 5l-0rc
6.. DB'.\IS t,lk,•s rare of In the file system co
User
updating some information.
of DBMS architecture ?
iii. 3-Tier architecture: . another layer between the c~e~t
.-..rl 1 The 3-Tier architectur~ con tamsIi nt cannot directly commuruca
·
andserver.
In this architecture, c e . .
The DBMS design depends upon its architecture. The basic client/ with the server. . d interacts with an applicat1or
sen·er architecture is used to deal with a large cumber of PCs, web The application on the che~:ates with the database system.
servers, database servers and other components that are connected 2. server which further comm . t ce of the database beyond
WJ.th oetworks.
2. DBMS architecture depends upon how users are connected to the 3. the application server. T t
End user has no idea abo~t tt\:~:s::lso has no idea about any
ation
database to get their request done. other user beyond the app ica . . of large web application.
Type. of DBMS architecture: 4. The 3-Ti e r architecture is used m case
i. I-Tier architecture:
1. In this architecture, the database is directly available to the user. Database
2. Any changes done are directly done on the database itself. It does
cot provide a handy tool for end users.
3. The 1-Tier architecture is used for development of the local
application, where programmers can directly communicate with
the database for the quick response.
ii. 2-Tier architecture:
----
Data modt.'ls ;
1 Dal.a models define how the logical structur
Data od Is e of the databas .
5.
a.
all.
Object-oriented model :
Object-oriented models were introduced to overcome the
shortcomings of conventional models like relational, hierarchical
la m e - are a collection of conceptual t I f, e IS modeled
~ tionships, data semantics and consiste:c:sco::es?ribing data, data. b.
and network model.
An object-oriented database is collection of object.'! whose behaviour,
ta models define how dat . ramts.
lll"e proc-essed a is connected t h state, and relationships are defined in accordance with object-
and stored inside the system. o eac other and how they oriented concepts (such as objects, class. etc. ).
Types of data models ;
L ·
Enti ty ~lationship model : Que 1.10. j Describe data schema and instances.
L . relationship (ER) d 1
'fhe entity
~ ca1J d • of b ·
. . and f moI e. consists 0 f a co11ection Answer
' e entities
b. En . . o re ationships am h as1c 1. The description of a database is called the database schema. which
t1t1es are represented b ong t ese entities.
attributes. y means of their properties, called s pecified during database design and is not expected to change
freque ntly.
2. Most of the da ta models have certain convention for displaying schema
as diagra m which is called as schema diagram.
3. A schema diagram displays only some aspects of a schema. such as the
names of record types and data items, and some types of constraints.
For example : Sch ema diagram for studentinfo database
Student (Name, Student_number. Class. Branch)
Course (Course_name. Course_number, Department)
!. ~ . . LU. 'l'Jie BR model.
Instances:
I. IDodeJ: 1. The data in the dat abase at a particular moment is called a database
'nie relational mod I
by. a t.ollect. s tate or s naps hot. It is also called the current ~et of occurrences or
e represents d
Wi th uniqueion of tables, each of ata_and relationships among data instanct>s in the data base.
llaJl)es. which bas a number of colu.DlIIS
t Svstcm 1-11 A (CS/}"'
Ll 1tabllsr Mana.,'l'nlt'l\' • ----------- J.•Se•.....,,5)
- 1, each schl'ma construct has its own CUr 1_12 A (CS/IT-Sem-5)
I!. In a databa~c sta l, rent Set of Introduction
i~tanl-ei: 1,,, ,., 1n be constructed to correspond to a
d ba.~c s1ii-, " - Parr ~ 8 wer
g_ Milll) ala · Every time we msert or delete a record or ch lcuJar
aha,_"(' !ll'hema. ang th
dat ·d 1 .1 , 111 in a record, we change one state of the datab 8_ e Class ifi cation of database languages :
,-alur of a a a • l ase tnto
amither state 1. Data Definition Language <DDL) :
....,
b. For output, a similar conversion from text or numbers into speech
. . , .... Explain DBMS interfaces. What are the various DBMS takes place.
ialfff-? 6. Interfaces for the DBA :
a Most database systems contain privileged commands that can be
used only by the DBA's staff.
D11118 interfaces· A database management system (DBMS) interface is a b. These include commands for creating accounts, setting system
~ lll£emre 1l'bich parameters, granting account authorization. changing a schema.
TUhout UEma the allows for the ability to input queries to a database and reorganizing the storage structures of a database.
V . query language itself.
--.,
. _ DBIIS mlerfaees are:
L .lleall-bued.
Que l.lli.1 Briefly describe the overall structure of DBMS.
llllerfaces for web clients or browsing. OR
L 1-· • Draw the overall structure of DBMS and explain its components in
that le~rfat:es Present the user with lists of options (called menus)
b n..u user through the formulation of a request.
' ""-down menus are a very popuIar technique
· lllterfaces. . .
brief. IAKTU 2018-19, Marks 07)
m Web-based user
I PART·3 I
I
_ ~!_o~a..¥:.1:1~1:a~:_r_:
Data Modeling using the Entity Relationship Model: ER Model Concepts.
Notation for ER Diagram, Mapping Constraints
Questions-Answers
pu rpo se of the ER
dia gra m ? Co ns tru
ct an ER
• · or an Qu e 1.18. / Wh at is lud e inf orm ati on
sh ou ld inc
ship : rsi ty sys tem wh ich ich stu de nts
'- Relat ion dia gra m for a Un ive sor s, co urs es, wh
t pa rtm en ts, pro fes wh ich
the ass oci ati on b we en en tit ies ab ou t stu de nts , de fes so rs are tea ch ing
a. A rel ati ons hip is e or entity rol led in wh ich co urs e, wh ich pro rtm en t off ers .
are en a de pa
OCrurrence. de s, wh ich co urs e
b Re · rep res en ted b . . l co urs es, stu de nt gra
lat ion shi p is J dia mo nd wi th
str aig ht
mes
connectmgtheentities. An 1w er
~--.. dia gra m :
. Pu rp ose of the ER of the
J d b
What do you understan Y att rib ute s an d do ma in ?
11:pqm van oaa typ es of attributes us ed . I. ER dia gra m is use d to rep res ent the ove ral
l logical str uct ure
I
l da ta mo d e.
UJ co nc ep tua database. dat aba se an d no t on
the
gra ms em ph asi s on the sch em a of the nge d rar ely
2. ER dia sch em a of the dat aba
se is cha
Aun'bute.: ins tan ces because the l str uc tur e of dat aba se
to en d
mu nic ate the log ica
ful to com
which are 3. It is use
l Attributes are propervalties
ues ., use d to rep res en t the
ent itie s
·
users.
2. All attributes have
· e ent ati on tool.
,ro rex amp Ie, a stu de nt en tity ma y hav It ser ves as a doc um orm ati on to re
-,an dag eas att rib
- .. ute s. 4.
der sta nd ing the inf
-
3. _: __ aba se des ign er in un
5. It hel ps the dat
·-- ad ol !J ai n orl'8Dgeofvaluesthatc be assigned to att nbu tes con tai ned in the dat
aba se.
-1
4. For
h.. ...~ .
l Adomau u,
a itu den ta IIIUne
a1~":'"'e.
ic. A stu den
· an au "b
t's
ie d
ca nn
for
:':
tha
an
ot be a_n um eri c val
neg ati ve, etc.
Attribute do inscanbeve u e.
l'Jlea llla rt
ry large, or ver y sho
ot•ctri&ate. llaed . .
ID co nc ep t al d ata mo deJ .
. Su.pie rihuCti·Siin le u
fie,i;.,~':ta • P att rib ute s •
ic val ues , wh ich can
not
-•-~
1od.igit, r. For exa mple, a stu d are .at om nu mb er is an atomic
"llaeo1 ent s ph on e
· Um vem ty 1ys tem .
J'tc. J.1&.l. BR clia gn m far
I
f
__M_an_a_ge_m_en_t_S_ys_t_em__________1_-_1_9~A. (CSIIT
_011_1_abase
·Sl'rn.51 Introduction
l-20A (CMT-!fom-5)
•1"1 .
Draw an ER diagram for a small murketiugc 0
number, year, 1mmestor section number, instructor(s), timings and
_.,
databue. usuminl your own data requittm<>nts. lllPany classroom; (c) students, including student-id, name and program;
~
jAKTU201&.17 ' Marks 7.3
and (d) instructors, including identification number, name
deportment and title. Further the enrollment of students in courses
and grades awarded to students in each course they are enrolled
for must be appropriately modeled. Construct an ER diagram for
the registrar's office. Document all assumption that you make
about the mapping constraints. [ AKTU 2015-16, Marks 10 j
Answer
In this ER diagram, the main entity sets are student, course, course offering
and instructor. The entity set course offering is a weak entity set dependent
on course. The assumptions made are :
a. A class meets only at one particular place and time. This ER diagram
cannot model a class meeting at different places at different times.
b. There is no guarantee that the database does not have two classes
meeting at the same place and time.
2
---
Aa,ftr7
- 21 A (CS'JT_Q_
- - - - -- -I-
- System ~lll-5)
B
Introduction
Fig. 1.21.4.
A PART-41
Key11, Conce!pt of Su,wr K,,y. Candulat, Key,
Primary K,y, ChMrolizal1on, Aurr1atwn.
-- -~ ----
llL l'la.~
Ma~y lo one : A .
"lll1ty in fl
1111y
II •·nt1ty i11 A iH IIH .111
'u nd un 1•ntity in
. .
Hoc t 1•d with at 1110111 0111•
111 1111 1>t-r of1•11titii•H iu A.11 ' 1lflWc•vc•r, r11n ht• ll/ls1wiut~•cl with
~•LILI niHCU!IN tht• candidate k('y, 1>rimary k<•y, 1iul)('r kc•y,
<"Ompt>Nit,1 kt'y and alh•rnatt• kt•y.
Database Management System l-23A (CSIIT-S
etn-5)
Introduction
1-24 A (CS'IT-Sem-5)
OR
Explain the primary key, super key, foreign key and candid 4. Composite key :
r:--==:::----- ate key
withexample. jAKTU 2017-18 M ~ a. A composite key is a combination of two or more columns in a
OR 'a~ table that can be used to uniquely identify each row in the table.
Define key. Explain various types of keys. b. It is used when we cannot identify a record using single attributes.
!AKTU 2019-20, Marks oi] c. A primary key that is made by the combination of more than one
attribute is known as a composite key.
5. Alternate key :
1. Ke~ is a attribute or set of attributes that is used t 0 1.d . a. The alternate key of any table are those candidate keys which are
entity sets. entify data in not currently selected as the primary key.
b. Exactly one of those candidate keys is chosen as the primary key
2. Key is defined for unique identification of rows in tabl and the remainders, if any are then called alternate keys.
Consider the following example of an Emp1oyee table · e.
c. An alternate key is a function of all candidate keys minus the
Em~loyee(EmployeeID, FullName, SSN, DeptID) . primary key.
Vanous types of keys are : d. Here in Employee table ifEmployeeID is primary key then SSN
L Primary key : would be the alternate key.
- .....................
G1■
L
b.
~
1ft the•
iaapr--■ ia wllidt l.v lower lenl eutitiee comliine
lltlna . . . . . . . ....,.
ftiab:AI ap .........
........
c.
_._ lintir
G
,
;...-ID....Y ·x lbaaillli)aritiell . . . . . ,.,_....a
J
tj
~::_::~~.,~~~~~~~:;:;=======~---,
Database Manauement System 1-27 A (CS'Jl'.Se
lll-5) 1-28A (CSIIT-Sem-5)
. of ER schema t o tables.
Introduction
Answer
I . ditTPrent notations or
e represented using the ollrrtion oftabll's
In ER model. database :.tions can be rc~uced. to,nt can Ix' rl'prc>t-C'nlt•d
1. di grams and these no . tor relationsh1p ~c
•
Inathe database, ev ery entity se
2. I ~ rm
flll.l.MI, D . . . . witbaggngation. in tabu ar O • • ER diagram :
Compariaon : Consider following
PART-~
1
ftiWa Llatd«i ER Model,
~Dwr-
Database Management System 1-29 A ( C ~
Introduction
OA(CS'IT-Sem-5) _ _ _ _ _ _ _ _ _ _ __
Basic rules for converting the ER diagrams into tables are : 1-3 -- .
1. Convert all the entities in the diagram to tables : • en ER diagram is :
Table structure for giv
a. All the entities l'l"prc.~ntro in the rectangular box in the ER diagram SubJect
become indrPl'Odt>at tables in the database. Lerturer
Lecturer ID Subj••ct ID
b. In the ER diagram. Student, Course, Lecturer and Subjects fonns
ind.widwu tables. Lecturer Name r SubJl'cl Nnmc
D
l.et·tun'r I
2, All singlt"-valuf'd attribute ht'Comes a column for the table : Course_lD
Ooor_No
a. All the attnbuk>s, whosl' value at any instance of time is unique,
art' con.~idered as rolurnru; of that table . Street
h. In the Student entity. Student_Name and Student .ID form the City
column of Student table. Similarly, Course_Name and Course_ID State
form the rolumn of Course table and so on. Pin
Course ID
3. A by attribute of the entity is the primary key :
a. All the attributes repn•sented in the oval shape and underlined in
the ER diagram are considered as key attribute which act as a
primary key of table.
Student ID
b. ln the given ER diagram, Student ID, Course_ID, Subject ID, and Hobby
Lecture_ID are the key attribute of the Student, Course, Subjccts
and Lecturer entity.
nt Ievei. ot d.._
-- ••din aal