0% found this document useful (0 votes)
37 views17 pages

DBMS (Unit - 1)

1. A database management system (DBMS) is software that allows users to create, manage, and access databases. It provides an interface for users to perform operations like creating databases and tables, storing, updating, and retrieving data. 2. A DBMS provides protection and security for the database. It allows multiple users to access the database concurrently while maintaining data consistency. 3. Key tasks performed by a DBMS include data definition, data manipulation, user administration, and backup/recovery. It allows creation, modification and deletion of database objects and data.

Uploaded by

divyanshi kansal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views17 pages

DBMS (Unit - 1)

1. A database management system (DBMS) is software that allows users to create, manage, and access databases. It provides an interface for users to perform operations like creating databases and tables, storing, updating, and retrieving data. 2. A DBMS provides protection and security for the database. It allows multiple users to access the database concurrently while maintaining data consistency. 3. Key tasks performed by a DBMS include data definition, data manipulation, user administration, and backup/recovery. It allows creation, modification and deletion of database objects and data.

Uploaded by

divyanshi kansal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

Introduction

I- 2A (('S/J'l' .H<•m •li)

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

CONTENTS Que I.I. j What is database management system


by use rs in DB MS ?
(DBMS) ? What

are the task s per for med


........................ l-2A to 1_8
Offrv~w. Database ............ A An swe r
Part-I which is use to
Svsiem vs File S~·stem, em (DBMS ) is a software
D~tabase System Con cep t 1. Dat aba se man age men t syst MyS QL, Ora cle, are co= erc ial
exa mpl e,
manage the database. For
and Arrhirecture diff eren t applications.
data bas e which is used in
rations like database
.................... l-9 A to 1-l 6
A rface to perform various ope
Data Model Schema and ...... 2. DBMS provides an inte , crea ting a tabl e in the data bas e
Part-I epe nde nce creation, stor ing data , upd
atin g data
Instances. Data Ind
and Database Language and etc.
e. In case of multiple
Interfaces, Data Definition and secu rity to the databas
3. It provides protection
Language. DML, Overall
consistency.
users, it also mai ntai ns data
Database Structure rs the foll owi ng tas ks :
DBMS allo ws use tion, and removal of
................... 1-IGA to l-22
A is used for crea tion , modifica
Data Modeling using ............ : 1. Dat a def init ion : It n of dat a in the database.
Part-3 the org aniz atio
Relationship Mod el data bas e objects tha t defines
the Entity ification, and deletion
n used for the insertion, mod
ER Model Concepts, Notatio 2. Data upd atio n : It is
bas e.
Constraints of the actu al data in the data
for ER Diagram, Mapping the data bas e
l : It is use d to retr ieve the data from
.................... l-22 A to I-27
A 3. Dat a retr ieva pos es.
Keya. Concept of Super ...... tions for various pur
Par&-4 which can be used by applica ing users,
Key, Candidate Key ,
tion : It is used for regi ster ing and monitor
ion, 4. Use r adm inis tra secu rity , dea ling with
Primary Key, Generalizat mai ntai nin g dat a inte grit y, enfo rcin g dat a
rec ove ring
Aggregation nito ring per form anc e and
con cur ren cy con trol , mo failu re.
unexpected
................ l-27 A to I-32A information corr upte d by
Pan -I Reduction of an ER Diagramel, S?
to Tables, En.ended ER Mod
Relationship of Higher Deg
ree
I
What are the adv ant age
s and disa dva nta ges of DBM

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

d tak e the benefits of database. The


the need and way of accessing the
Answer
Database administrators are the personnel's who has control over data and
programs used for accessing the data.
Functions/role of database administrator <DBA) :
1. Schema definition:
a. Original database schema is defined by OBA
L ~.
OD Jll"Oll'8mmen : b. This is accomplished by writing a set of definitions, which are
L nae, lr"e the developers who .
elDMLq11mes,
.
mteract with the database by means
translated by the DDL compiler to a set oflabels that are permanently
stored in the data dictionary.
b. 1 -DML queriee are . . 2. Storage structure and access method definition :
C++, JAVA, Puca! etc written m the application programs like C,
a. The creation of appropriate storage structure and access method.
~ 1- . .
ciuenea are converted mto
· . b. This is accomplished by writing a set of definitions, which are
thedataba.e. obJect code to commllDicate with
translated by the data storage and definition language compiler.
~ llephfrtf l-9111en,
L They Ire • 3. Schema and physical organization and modification :
u.ertl'de•~
-UJ>datedevelopers
data . SQL queries
' whO wnte to select/ a Modification of the database schema or the description of the physical
b. The, direct . . storage organization.
like 8QL ly mteract with the da b. These changes are accomplished by writing a set of definition to do
c. · tabese by means ofquery language
modification to the appropriate internal system tables.
'"-111eracanbe ·
ltudy 8QL and DBMs
IClentuita engi
to &pPj heneers, an~ysts who thoroughly
Y t concepts m their requirement.
Database Management System
l-5A
4. Granting of authorization for data a (C&-Jl'. Introduction
types of authorization for data acces.s to thecce~s : DBA °" ~"1.5l
. . various a• ants . i--0A (CS'IT-Sem-5)
5. Integrity constraint specificatio . Usersofth difl'er
administration in data dictionary such as d:fi· _DBA carr edata~nt
IUng constr _Y O\Jt d e.
Que t.6. 7 Explain the differences between physical level,

Que u. 7What is data abstraction ?E .


xp1ain dift
¾its. ata
conceptual level and view level of data abstraction.
I_AKTU
___
20_1_6-_1_7,-M-a_r_k_s_l_,O~

abstraction. erent le\>els


,_,,. 7 Of
Answer 7
Data abstraction is the process of finding irrel
. Physical level ConceptuaJ/ View level
s.No. Logical level
hiding the background details from the users evant details fro
This is the highest
Different levels of data abstraction : · Ill User i.e·, This is the lowest This is the middle level
1. of data abstraction. level of data
level of data abstraction.
abstraction.
View level It describes the user
It describes how It describes what data
IView 1 / / View J / ........... .
2.
data is actually is stored in database.
interaction with
database system.
stored in database. -
the It describes only those
Logical level 3. It describes the It describes part of the database
complex low-level structure of whole in which the users arc
data structures in database and hides interested and hides
Physirnl lcvl'I details of physical
detail. rest of all informal ion
storage structure.
fll. U.l. 'nae tb1N 19¥111 of da•·
.. a bstractwn from the users .
L Phy1ical level : A user is aware of the
-
4. A user is not aware A user is not aware of
i Physical level is the low t 1 the complexity of complexity of
the data are actually sto csd cvcl of ubstrnction and de.lCnbes .ho,r of the complexity
database.

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\

!~H'.\IS prolt'(ls the


'

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

l roocum•nt access of data using


~,•mt> form of locking. d' .
, ncurrent
access h as many proble .
lllsl~e
~e I ir~ctmg the file While other
e eti_n g some information or
Application
Clieot

User
updating some information.

q.. I.I.IDiscuss the architecture of DBMS. What are the types


Fig. 1.8,1. 2-Tier architecture.

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:

I. The 2-Tier architecture is same as basic client-server.


2. In the two-tier architecture applications on the client end can
directly communicate with the database at the server side. For
this interaction, API's such as : ODBC, JDBC are used.
2· ·
The user tnterfaces . • programs are r un on the
and apphcatton
client-side.
Oataha ~l' M:tn.t/;'<'Oll'llf Sysf c•rn

JOA /CWl'f -1-km •li) Introduction


/ PART-2 /
t, f{1•h1t ion;,f dut.1, model i11 usNJ for data s Uirag" and processing.
0.,,, J,lod,/ S,hnna and J,i.~/anr,·s, Va tr 1
~ L. La dJ , ndep,•11 I e r· Thi11 m11dt-l is 11irnpl1: ;ind i~ has all th•· properties and capabilities
Da- ~ a11
11/{UlJ/{f' n/t>rfare~ /) ' 1'11,•
1
/.a ltl(llagr', DML. 01 •1•,nl/ . (Is·"fr11IJ,,r,IJ/fi,,,,
Data{:;, -'<', '"'" rr•quir1·1l to prwt •SB d:,t.a with str,ragt! 1·fficfonr.y.
•t
( """· :,. Hforurchicl•I model :
11 I n hwrr,rrhir;,J modr•l rh,t.:, rkmr,ntil are Jink1•d as an inverted tree
HLrnc,turn (mot flt t.h•J tt,p with branches formr,d below).
Questions-Answt•ni
---------
.... ,...._Type and Medium Answt•r '1\.-
J.
1
/$1- low tJw 11ingJ1; root dat,a r:fcmcnt an: s uhordinate eJ,,ments each
of which in turn ha s its own s ubordinatf! el•·ments and so on, the
tr<;<• rnn grow to multipll, if:vcls.
~~ -- ::_.rp~ e Qut•~t. ns
._-::-::::--:-===--=---------_:• _ __ '
10
c. D,,t;i c,l1•m1•nt has parent child relationship as ma tree.
4. Network model :
ICla Lt. JWhat are data models? Brie~ Yexplrundjff a. This model H, the extension of hierarchical data model.
data mocMs. erent tYpesor b. 1n this model there exi'!t a parent child relationship but a child data
element can have more than one parent element or no parent at

----
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) :

-UI, IDescribe data independence with its tyPes,


a. DDL is set of SQL commands used to create, modify and delef~.
database structures but not data.
OR b. 1 DBA to a limited extent, a database designer,
They are used by the
or application deve oper.
Explain data independence with its typers-;.;;:;;;;;;-~:-::--::-----
c. Create, drop, alter, truncate are commonly used DDL command.
AKTU 2019-20, Marks 2. Data Manipulation Language <DML) :
07
..... I a
A DML is a language that enables users to access or manipulates
data as organized by the appropriate data model.
Data independence: Data independence is defined as the capacity to change There are two types ofDMLs:
the schema at one level of a database system without having to change the b. d
schema at the next higher level. i. Procedural DMLs : It requires a user to specify what ata
Types of data independence : are needed and how to get those data.

L Physical data independence : Declarative DMLs (Non-procedural DMLs) : It re~uires


ii. a user to specify what data are needed without specifying
a. Physical data independence is the ability to modify internal schema how to get those data
without changing the conceptual schema.
c. Insert, update, delete, query are commonly used DML commands.
b. Modification at the physical level is occasionally necessary in order Data Control Language (DCL) :
to improve performance.
3. a It is the componen t ofSQL statement that conlrnl access to data
c. It refers to the immunity of the conceptual schema to change in the and to the database.
internal schema.
b. Commit, rollback command are used in DCI
d Examples of physical data independence are reorganizations of 4. Data Query Language (DQL) :
files, adding a new access path or modifying indexes, etc.
It is the component of SQL statemen~ that all? 1ting data
2. Logical data independence :
a from the database and imposing ordenng upon it.
a. Logical data independence is the ability to modify the conceptual b. It includes select statement.
schema without having to change the external schemas or
application programs,
5. View Definition Lan~age (VDL) : d their mapping to conceptual
l VDL is used to specify user views an
b. It refers to the immunity of the external model to changes in the
conceptual model.
schema. ail hie to classes of users.
c. Examples of logical data independence are addition/removal of 1. rlefines the subset of records av a li"'·e conceptual
entities. · appears to users "'
l L creates virtual tables and t he vtew
level.
1111111 Describe the classification of database language. Which
tn,e of lan1Uafe is SQL?
4. It specifies user interfaces.
SQL is a DML language.
Di
1CU1a tbe following tenns (i)
OR
DDL Command (ii) DML command.
I . d e t ai'I with example.
. . 1.11. Explain all database 1angu ages m
IAKT(J 11111-1s, Marki•• I
~ Dlt-20, Marb 07]
lnlroduetu,n
J,'ormN-bUHt'd inlcrfac1•H:

!!:."L-,,r-~: !l.-frrl~. 112. Pa~l' I- LI,\, U111t-L 11


Ii
/I formH-bHA(•d int~rfncc displays a form to eath u~<·r.
u~rra cun fill out all of the form <'ntries to in.sr•rt nc d
I rt · • • ·w ata, nr they
~: ('1111 fj~ out on YC(' atn c•ntneR, tn which the DBMS Wtll retrieve
matching data for the remaining cntnc~.
~,~AI TEK D!«H'. TRl1NCATK l'Ol\lMENT, GRANT 0 ,,, Graphical user inlerfaceR(GUT) :
\"" , •1.CVQJ{E: 3,
~!tllll'DI t.L A GUI typica lly displays a schema lo the user tn diagrammatic
DML: form .
\SERT. l'PDATE, nr:u:rn ~tntl'ml'nt b. The user then can specify a query by manipulattng the diagram. In
00.: many cases, GUis utilize both menus and forms.
GR.1-.\'T and RE\"OKE st.1temmt Natural language interfaces:
4.
DQL: a. A natural language interface has its own schema, which i,; similar
SEUXi >tatemcnt to the database conceptual schema, as well as a dictionary of
\'DL: important words.
~ Tit'II" ,mp5 as b. The natural language interface refers to the words in its schema,
as well as to the set of standard words in its dictionary to interpret
~lfrt • from employee
the request.
,men, dno = 5 ,
c. If the interpretation is successful, the interface generates a high-
<n-~ TieW for dept 5 employees. level query corresponding to the natural language request and
• Cffal.t'l'X'W t111pdept as submits it to the DBMS for processing; otherwise, a dialogue is
seled £name, !name, d.no, d.name started with the user to clarify the request.
from emplo.)'l'e. department 5. Speech input and output :
Qre dno=dn1ID1ber : a The speech input is detected using a library of predefined words
and used to set up the parameters that are supplied to the queries.
Creates view using two tables.

....,
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

They are also often used . hr . .


...,...I
to look through th ID owsmg mterfaces, which allow a user A database system is partitioned into modu.les that deal with each of the
llnatructUJ"ed m-~~ contents of a database in an exploratory and responsibilities of the overall system. The functional components ofa database
-u,er.
system can be broadly divided into two component~·
D.it.ioo!(l ~,w~'"l'mrnt s~ ~ll'm
-------- -------·
J-16 A (CSIIT-Sem-5) Introduction

c. File manager: It manages the allocation of space on disk storage


and the data structures are used to represent information stored
on disk.
d. Buffer manager : It is responsible for fetching data from disk
storage into main memory and deciding what data to cache in main
memory. The buffer manager is a critical part of the database
system, since it enables the database to bandJe data sizes that are
much larger than the size of main memory.
2. Query Processor (QP): The Query Processor (Query Optimizer) is
responsible for taking every statement sent to SQL Server and figure
out how to get the requested data or perform the requested operation.
I
I
I
The QP components are :
I a. DDL interpreter: It interprets DDL statements and records the
I
I definition in data dictionary.
I
I
b. DML compiler: It translates DML statements in a query language
I into an evaluation plan consisting oflow-level instructions that the
I
I
query evaluation engine understands.
Query processor : c. Query optimization : It picks the lowest cost evaluation plan
------1 from among the alternatives.
I d. Query evaluation engine : It executes low-level instructions
I
I generated by the DML compiler.
I

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

Long Answer Type and Medium Answer Type Questions

Que 1.16. j What is ER model? What are the elements of ER model?


L Ston,e Ma-~ 1,11,l. Overall database structure
,.__ ----.er (SM) : Astor . · OR
Pl'OVI.....,, the interface betw age manager is a program module that
What are the notations of ER diagram ?
~ the application program~:!~e low _level <lat~ stored in the database
components include. quenes submitted to the system. The Answer j
L Autborizati . . An entity relationship model (ER model) is a way ofrepresentingthe entities
satisf:action . ofon and integrit Y manager : It tests for the
integn·t and the relationships between the entities in order to create a database.
b. ~~cess data. Y constraints an d ch eeks the authonty
Ulen to · of
10D man
a co111iate ager: It ensur th
Irani.a . nI state despite of es at the database remains in
8 5t
ctton executions p Y em failures and that concurrent
rocepd without conflicting.
S,1 sf c•rn
Dauba."I' Managrmc•nr 7 A CC&r]
-----::: 'l'-Se..··•·s, Introduct10n
m.
Elt-ml'nWDolalion of ER mod<>Vdia.,..a .... l-1 8 A (CS'IT-Sem•5)
s are ma de of mo re
than
J. Entity: : Composite att rib ute e ma y hav e
h .
I \I orl d objt>ct tha t c an e ea.~I) • 1. 2. Co mp osi te att rib ute de s
nt' com ple te nam
s. An rnh.ty 1s .1 m1 Fo r exa mp le, a stu
j deotifiabl
e. one> sun pie at. trib ute
t rnd . _ nam e.
b. An ,,nt1tJ r in be• ab.s first_ nam e an d last
att rib ute s tha t do not
,,rt tha t exists an d is riv ed att rib ute s are the
r An •'Dtity is 11n obj b
dis tin gu ish ak 3, De riv ed att rib ute : De
values are der ive d from oth er
~m dat aba se, but the ir
ala ry in a
o!:uttts 0 ther exi st 111 the phy sic al r exa mp le, ave rag e_s
- att rib ute s pre sen t
in the dat aba se. Fo dat aba <e, in.s tea d it can
Entity set : en t sho uld no t be sav ed dir ect ly in the
de pa rtm
tion ofs im iJa r tYPe of eo titi e
a. Entity .set is a rollec be der ive d. !ringJe val ue
h s
roo tai o en ti tie -~ wi.t att rib ute sha rj lue att rib ute s contam
b. An enh ti· set ma1· 4. Sin gle -va lue
att rib ute : Sin gle -va
rn.lues. · · ng 511llila, Se cur ity _N um ber
I Fo r exa mp le, Social_ s ma y contain more
tha n
S. Attribuk': I lti- va lue att rib ute : Multi-value att rib ute tha n on e ph on e
5. Mu hav e mo re
. mp le, a per son can
cha rac ter ist ics of or,e val ues . For exa
An attribute gives the .
a
b. lt is also called as data ele
elementan• item ·
me nt
'da
the en tity
t
ta field, a field • a da a item I nu mb er, em ail _ad dre ss, etc

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

'Val11ee that are n. ute


~t
age

ie d
ca nn

for
:':

tha
an
ot be a_n um eri c val
neg ati ve, etc.

con str ain t which det


t att rib t
e .
ue. It has to be

ntu ne s the typ e ofdat


a
ER dia gra m:

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.

~- uo.1. BB diagram for Uniffnity.


I
Qae Ul, Describe mapping constraints with its types.
ftldti OR
Describe mapping constraints with its types .
tile t ~
A -.h
ersit7 ~
.. .-...-.,---..-.,,-1
IAimJ----
.,....__. ent.ltie. (a)cou---. . • office lllaintains data about
- ~ i ._ _::.---.
- fh)
ancludin
eour.e oft, «.number, title, credits,
ertngs, including course
Jl.itnba~l' M11n,1g1•nwnt

2
---
Aa,ftr7
- 21 A (CS'JT_Q_
- - - - -- -I-
- System ~lll-5)

~tappmg ron~traints act n:- a rule followed by contents Of datab


IJJta m th£> dat:ihasP must follow the constraints. ase.
-- 1-22 A (CS/IT-Sem-5)

B
Introduction

'I)Jl'• ofmnppmg constraints arc:


I. Mapping rardinalities :
a. Mappmg cardinalities (or cardinality ratios) .
vi the number of
~pecifies
1•nt1t1es of which another entity can be associated
srt. a a relationshi
b Mopping cardmalitics arc used in de .b. p
sets Ith h h sen mg binarY re Iationshi Fig. 1.21.3.
- . a ~ug t ey contribute to the des . .
cnpt1on of relationsL,P iv. Many to many: An entity in A is associated with any number
i:eL~ that mvolve more than two
en t·t
1 y sets. uip
of entities in B, and an entity in B is associated with any number
For bmary relationship set R betw .
mnppmgcardinality must be one oftehen,_entit~ sets A and B th of entities in A.
· e 10Uowmg . , e B
,. 0 ne to one: An entit in A . . .
entity in B and an _Y . I~ associated with at mo
l•ntJty in A· entity m B ts associated with at most one
st one

Fig. 1.21.4.

2. Participation constraints : It tells the parlic1pation of entity s<•ls.


Fl.. 1.11.1. Then' arc two types of participations:
ii. Onetom any: An l'ntity i A . Partial participation
. · in11fl hIii nsHociatl•cl with uny num 1x•r
0atf l'nlltil's· in /J · An l'nllty ii. Total participation
mo~t ont• <'ntity in A. , owcver, can be ussoduwd with

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.

a Primary key uniquely identifi h 6. Foreign key :


ne\"er, be the same for recor!ss ~ac ~ecord in a table and must a. Foreign key represents the relationship between tables and
choose either EmployeeID or SSN erel m Employee table we can ensures the referential integrity rule.
b Primary co umns as a primary k
. keyisacandidateke t . ey. b. A foreign key is derived from the primary key of the same or some
of entities within the table. y hat is used for unique identification other table.
c. Foreign key is the combination of one or more columns in a table
c. Primary key cannot be null.
(parent table) at references a primary key in another table (child
d. Any table has a unique prim
Super key: ary key. table).
2.
d. A foreign key value can be left null.
a A super key for an entit . For example : Consider another table :
combined value unique!: i:e::i~e:f one or .mo~e attribute whose
b. For example. H . the entity m the entity set. Project (ProjectName, TimeDuration, EmployeeID)
(E ere m empl;yee tab.le (EmployeeID, FullName) or
mployeeID,. FullNam a Here, the 'EmployeelD' in the 'Project' table points to the
3. Candidate key: e, eptID) IS a super key. 'EmployeeID' in 'Employee' table
b. The 'EmployeeID' in the 'Employee' table is the primary key.
a Acandida
. te key is a column
::iedata.lyidentify any dat~r set of column, in the table that can c. The 'EmployeeID' in the 'Project' table is a foreign key.
r se record without referring to any
b. Candidate key are in . .
j
Que 1.18. What do you mean by a key to the relation? Explain the
uniqueneBB of all thediVJ.dual .
columns m differences between super key, candidate key and primary key.
and SSN rows H . a table that qualifies for
. . are candidate key. ere 10 Employee table EmployeeID 1AKnJ 9011-11, ldarb 10 I
8
c. Minimal supe r keys are called. .
candidate keys.
Answer
Key: Refer Q. 1.22, Page 1-22A, Unit-1.
~

_ .......... ✓I ti p ■ d N dwaa1h,e11 I the


(ll

- .....................
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

lain the reduction


Employee Branch
I
Que 1.25, Exp OR

ER model into table ?


How to reduce an

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

&Na Geunllutloa lpecialization


I In generalization,
Aggregation
In spccializ.1tirin, an Aggregation 11 an/
J
the common enfity of higher-level ahstroc-tion through /
attributes of two or entity is broken down whit·h relnt1onah1ps
more lower-level into two or more ore lre11tcd 11..'! h1ghu /
entities combines entiti£'s oflow1•r lt•vpf. li•vcl i•nlJtJP
to form a new
higher-level entity. I
2. Generalization is a Specialization is a top- •
bottom-up It 11Jlm1,11 u~ to
down appro11ch. 111d1cntc• thnt o
approach.
rl'lntrnru;hip &C'l
partk1patc IO
11notJ1er rt>lntionsh1p
set
3.
It helps in reducing J
It increa..qes tht• size It 11lso incrcosc>s th!' /
the schema size.
of schema. size (If schema
4 It is applied to group
It can be applied to a
r- - ~
of entities. It is nppl1ed to group f
single entity. ofn•lation.sh1ps __J

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.

Tht- multivalut'd attribute is represented by a separate table :


a. In the student table, a hobby is a multivalued allribull-.
I
Que 1.26 · Discuss extende
d ER (EER) model.

b. So it is not possible to represent multiple' values in a single column


ofStudent table. Hence we create u table Stud_Hobbywith rnlumn Answer I ..pported with the nddi~i~~,'~1;,~~-~~'~'~i°nrl'ph
name Student_lD and Hobby. Using both the column, we rrl'ate 11 The ER mudc•I tha~1~s~ntity relntionsh1p mo.~ . . ii ER mmh·I
composite key. 1. is called till' exten c .. II the concepts of th,• un1-,rin.
[ · 1 pts ·
d
Tlw EER mo ,, II'. cludC's •
.·"additional conn• . . .
l'Ollllllna : attributes
C<llllpoaitt> are mergt'd into same table as different 2. • I the followrn,.. ''6 \ Umt-1
tni:l'lher w1I 1 ' . r Q 1.2-l, Pa!-[e 1 _,. t •
Specialization: RL (c, ~ 1 24, Pag-r 1 -2GA, Umt-1.
a. 1n tbe given ER diagram, studenl address is a compositc nttributt' u. t' o . R,•frr {, . . ·t l
~
It tontamsC,ty, Pin, Door _No, Street, and Statc Gt•nernlizn ,o . J P·1 '<' l 26A. Um - . . l
t st b. A !CI"<'l{ntion.· . Refer Q t.:A. ' · bl .vp,• ,•nlIil w~
upl'r t I pt• / su I
b. ln 1 be udent table, these attributcs ran meri:e us an individual
C0111lln..
6.
c. su1wr
Th,• g cl11$"1su lJC·l·as.·s tentity types (ors
·rnt modellin~ . :t. tl111I is indu< "' Ill
,·onst rut "
;3. . 1· ti • ,nost impor ' . .
~vNt •ttnbute,a are not considered in the tablt- : is on,• t> ll , ,uhd1nd,• it
the t •
n. In S udent table, Ai!,, is the derivt>d uttribute. th<' EER mod,•!. 1 11 '.s)
d •In ~•'1ll'rnl ,•ntity 1111d th1t·

b. ~can be cakula~'<l at any point of timl' by ralculatini: lhc di fT<'n'nc••


current date and Dnt(' of Birth (DoBl.
Wl'(>n
.\
.
ThisfN1tun l
' ,nublt"'!-- u~ to n10 t .
. ilizt'drntitytypl'S(sll
•r·,1 spt.'C'll .
into s,•n ' .
. h..·lasst•s or ~n l~ pt

d t,, c·1plurt• bus1ms.


l
. ' ~ ru t'' ~ur '~
Ii isconstrn111ts
. . ·l 1•s ,s nn ,,nt1t_1·
. . r' us<' • h . l ,up,•t ' .., I
fi. EER 1hn~r,1ms.'1 •~subtypt• rt'l,1twn,. T. us, •1 ·,ir<' tu h,• n•prr••·nlN ,n
. th,• sup,•r I} pt . . . t ·uhd,iss.•s t h.1l r, qi
10
. ·ludt'sd1stmr "
t_rp,• th,1t 11\t ," ,,nl~ r
adatnnwd,,l tl 1lh·1sudi,linrtn,h•und1s 111 11 011
.\ suhdw,;~ i~ on l'nt ,ty t., Jll' \; •
1; :,r·n siqwr dnss .
Datahue Management System Introducu n
~
------------- 1-31 A (CS'fr 1-32.A 1CS'IT-Sem..S)

b. These requiremenU' are expre55ed through different u.,c ca_a:e5

3. Interaction oven;ew diagram :


a. The interaction oven;ew diag-ram 1" an activity di.1!!Tflm made of
different interaction diagram, .

4.. Timing diagram :


a Timing IDIL diagrams are u..-ed to reprt',;ent the rdatwn~ t1f llbJ,.'<'ls
when the center of attention rest" on time
b. Each mdl\;dual participant is repre"t'nted through 11 lif,•line, whi..-h
is essentially a line forming steps ,-ince the indh idu,11 part ll"IP•lllt
transits from one stage to another.
c. The main components of a timing l 'ML diagram 1iri'
L Lifeline ii. State timt>lim'
iii Duration con~traint h·. Time con,trnint
,·. Destruction occurrence
5. Sequence UW.. diagraro :
a Sequence diagrams dt>scribe the Sl'ljlll'llet' of nws~.igrq 011d
interaction~ that happen between actor~ and olul'l'h

Ii 111 What ia Unified ModelingLan


lypeaofUIIL.
.
...
bda• n hip
.. -,· E,xplain d"N
b. Actors or objects can be active only wht•n nt>l'ded or wlwn 11not her
object wants to communicate with tht•m
.. -,a,.e c. All communication is repre1<entcd in u chronologit-ol manner
- h,erent
6. Class diagram :
a Class diagram.~ contain classes, alongside with their 1111 nhutf'S Ialso
1 Unified Modei;- referred to us data fields) and tht>ir hchaviours talso rt>forrcd to as
enabliug - . i Ulllguap (lJML
of a ~
software ..,..A to Bpecify, . ) ia a standardized modeling langu"'"'
· Villualu.e member functions) .
2. rnn UJD..,m. • construct and d ...,. b. More specifically, each class has three liclds thP class nomP ut thl'
unu, makes these . ocwnt-ot nrtifacts
top , the class attributes right below thl' name, the cl1L~S opN1ttions/
3. lJML is an im artifact, scalable, secure
de,eiop111ent PClrtant llllpect in I . and robust m t•xecutioo behaviours at the bottom.
4. I . vo ved IJl ob" c. The relation between different classes ( reprc•scnted hy II conni•ct mg
t Wlee K?aphic no . ~ect-orientcd sofnrnre
line), makes up a cla.~s diagram.
T)pea ofUMI... talion to create visual
•~
L ncQ'nty di• " ware systems
models of son
YBBY DIPOBTAN'I' QUB8Tk)i48
a. It· .._:
IBRenerally
actions.
....__
U8ed to deacribe
- can be i....~ the flow of diffierent activities and
. _ .....r, ..,,.. N17 u14 lanL Tino ..,_,.OIIO
b. •. _ . ... _,_, ,_,_,...-,oNALB as ...U •
c. 'Die, UUWl &equentia) . 8:0 Ii IJDIIINAffON.
a n d ~ the~ and IJl P&rallei
2. u laled, COllsumed
1'1!lation.sbi .
ae Cllae di..._ . P between the diff, or Produced by an activity Q. 1. What is databue management system ?
a. Case di • erent activities .
........,__ agrlllns - ReferQ. 1.1.
--.,""1llllenta. are llaed t o analyz h
e t e syS tem's high-level
.........~,.,......
l-33A(C&rJ,~

nt Ievei. ot d.._

1,ee0 witll ese111p1e.

-- ••din aal

You might also like