0% found this document useful (0 votes)
6 views

dbms pyq

The document discusses referential integrity and relationships within databases, emphasizing the importance of primary and foreign keys for maintaining data accuracy. It outlines the concepts of composite entities and anomalies that can arise in database management systems. Additionally, it provides examples and questions related to these topics for better understanding.

Uploaded by

Rex Graham
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

dbms pyq

The document discusses referential integrity and relationships within databases, emphasizing the importance of primary and foreign keys for maintaining data accuracy. It outlines the concepts of composite entities and anomalies that can arise in database management systems. Additionally, it provides examples and questions related to these topics for better understanding.

Uploaded by

Rex Graham
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

existing this,

So, Referential n In Ans, Q3. Composite Entity


we
relationships,
referentialassoClated eRelereatialWhat As. Q2. Ans. Q1.
Note
Companyld primary
CompanyName nccd Example: Give What ThisNote:iounj
{Tine
Three
: Year-
2020
Dec.
to integrity do EMPLOYEE Attempt : solution
altributes: example Attempt
Table integrity
Primary key cnsuretable) you are
in
dat a Integrity Entity the
that refcrs mean is
the relercnce is all provided ali
requires data linked NameLast
Middle
Name FirstNAME Employee of limitations Five qustinns
Çompanyld Samsung Apple
ProductNanie
Productld| parent
to : by a
the Name simple
table. that, both on betwcen areferential questions. by
primary accuracy Name First
Name (Please (Very Dr, *sper
whencver sides Figure of Vinay Introduction
Related
Table two composite file fstructiasa.
and can Refer Section-A Short
ofkey or integrity : Each Singhs
Composite be processing
the value more
a consistency NameMiddle Employee divided
foreign
relationship
tables.
Name
attributes
Ql3 question Answer
(in
MustangiPhone
key the
Thi s
? Attribute into Unit-
system.
DBMS To
valueremain primary of su b Questions)
isdata Name Last divisions Page-9) of Carries
is achieved withina an
Orphaned
Record
Associated X vV
Record usedintact. -
or entity. 3
parent like marks.
itrelationship. by
must having FNane. (Maximum
Marks:7%|
-
reference table), BCA-501
the ,
MName, [5
8
Becnuse foreign
a x
valid, LName. 3
obkey
en iouping lOage MS, B
moblSlornge
gnificant xANples
dutabase.ieLuad
What xisting
space One RENAME- dictionary.
COMMENT dataTRUNCATE-Is
the 0s - for IrdatabusNC.
om the databaso.
ALTER DROP- vloCREATE-ws, or kriptlons ohlsts DL
witheflect
attributes goal are
t
recordstable,
he
a objects
store
its
of
modify Deflni(Dtiaotandat!abasDEeLETE
database
of
ofor
the Data ERT bonples most commands
wltatblhine, a
UPDATEINSto of
DatM
aor
slatlon pulSOLat(pMDiLoatna hat
Mani 1of tdo ed
ytabld(eio.e1e.hsen'trelated
In
using th at
anomalles
on schema
of the
in -
isproceduro used
0s DDL,
the he SQL,
tabl e, . "record",orphaned
is lhe L
is data used isManipulation DMI
of dat a you an
the into the
databasc. is includng used (likocommands 0s
usod struturo
databaseschema.
connands Delinition
used uscd SOL present CxÍNtahble
relations base uscd aro
usedadd to used to delete table,
to Language) to|
: mean hu
BCA
removed. to insert itatements, Companyld" the
Contan%
space.rel ation
relations design to all to altor
and cronto
to 8chema It delete update
correclly in t that by prBy Vth
Sas in rename romove of slmply Languago
that Language the DMLand
1NTis spaces the ob<ects triggers).Index, database
: data database deals
Languaye)
Semnastur/
her (tlles) to
se sohemas
baAnot comments structuro the and can records
exiating Into a

rolations minlmize an allocated


rocorua
ul
fromfunctlon,
database deals
ls
objects used Actually
bo
And with
keyielno1eyn
field).This
|
serious occupy.
has objoct with
used
w6. from table. a belong, DDL? ntroductlon
key
tho to of the to to t his the of
is a
unitwoquely examplAidentity
e, Cundidate
T'he Keys : " column A
"records.
fidatabase
cld
more
or KeysDlstinctions
Prlmary
A : Key are ofairlbutes
relationships In
A y key.relation marks.
Ans.Keprimary carries
72 Note
following Clearly
relations.
he Anomalies%,
modification
0rbase
las1fied he
To
It primary for primary called a a
combination minimnal
records Jata. It
mustcannot cach ficlds,
and relational relatlon. key
What Questions)
Attempt :
databarse
and
relation problen
DBMSI
a designated
The is In ? Answer
(Short If
identiintics Stud tuple containcontain main keyrecordunique. key Superamong key
between
IhatDBMS key,
Explain Three make any
schemnas and into of2020/
a set whose database.
values. help do Section -B wl modification
table of No is is is Key Keys candidate aneotnalies
sure
ogerate anomalies insertion uodate
in of a any
can ecord aStoneuor known
attributes unique
anulfeature
l special
to uniquely The value field a diferent to you
the questions, ihat
dent uniquely value
Primary
: Ind1vidu.al
arc
uniquely an Two the are
o
thatanomalies,
12%
have more values. of or also difference mean
value primary relational
as altribute anomalies.
anomalies
identifies combinat:on for a oroyrams are no
the in fiacrelldCundi
sation.date which incach
Key, table, used key questions present,insertion,
for identify tablael the (2%72
by15] Each
m
same able, databasc recod value, identify and
present
can ke y primary and to iee
key thatwhose uniquely cach Candidate or that note
that between question a Desyn
deletion,
key. are establsh
columns
in a key out deletion
row record of a super update in a
value. is, value For table key the ntwo akey tuple setof of
hem
he
no of to
existing this, ( Ans. Q3.
So,
Referential
wete In
relationships, Cumpsite Ertio Atts Q2. i.
reterential What Note:
primary teedasSsiN Referential
Company : Evample Gve What Ihix 2020
lear
De.
1air
to do EMPLOYEE Attempt
key ensure integrity example stution
Primary
Table integrity
tabie) datlntegrity you attributes: are
a ld
in
mean EntiN the is
Company the that refers
is all pen
Samsung relerene
requires data linked
parent Name
Last Name FistNANME
Middkk tmvr oflimitations
ProductNanne
Ompanyld|
Productld Apple ktby
to : by a Fve
the Name simple
Name table. that, on betweenreferentlal
primary
a
both accuracy Name, Frst
Name
(Please questions.(Very VinayDr.
Related
Table whenever sides Figure
two composite
file Short
of Inirvdu
and can Refer
ofkey orintegrity Composite : be processing Section
Each -ASinghal
a the more
consistency
value Employe* divided
foreignremain
relationship
tables.
Mikdle
Name
Name attributes Answer
Q13 question tion
(in
Mustang iPhone Uni-l
key th e
This of
? Attribute into lo
primary sub Questions)
system.
value
isdata
Name Last divisions Page-9)
of
carrles DBMS
is achievedwithin an
Orphaned
RecordRecord
Xv
Associated usedintact. or- ontity. 3
parent by a like marks.
it relationship. |Maximum
must having LName.
FName,
-
reference table), BCA-S01
the MName,
[5 Marks
Beeauseofforeign
a x
valid, 3 75) :
key =
Ans. S. 151
wiemth Mouping
MOblgnificant > > Sramples
database. the Lule fin e D L (Data L
abastablee. witUPhaiblnDeAT.INaESEaRT-mplDML:
es of
ge Definition
space One What existing
dictionary.
RENAME COMMENT datathe TRUNCATE- for from database. the database.DROP views, CREATE
ALTER or riptions Language
pApILNManior
a on pulna(DptMiLatoanwhat suled tabledtohtheeatsn'rtelated
latl des
and the of or
attributes
eflect goal th e its modify datDELETE-
th e most the
th at are records table,
a objects
store
- of database of Da ta Manipulation pat
th i
as
ofofdata do ln
using schema of in - is DDL- the SQLo commandsthe DDL?you Th(li.so.
is the
an
anomalies
on the the - is
used
procedure 0s th e
database,commands Definition
-is i
is "orphaned existtable
the : into base database. is including
storage -
are is
used (like used structure schema. used used
used SQL present
used used is to commands mean
ield). the in RCA
relations relation design removed. used to delete table, Language) : to to
to
statements. that
"Companyld"
contains
space. relations in
to
to to al to alter and create
schema
It
Language delete a updateinsert in by
record". primary Vh
remove of that the
as is rename add spaces simply deals DML
base schemas(iles) 1NF? to the objects triggers).index, database
: data database Langunge)
Somester
Another comments structure the and can records
existing into and toreign a

relations minimize an allocated al deals


is be key
function,
from database wi th
records objects used actually used from andbelong fieldIntroduction /
serious occupy. has object
of the with data
table.
: key
to to
is a the to of
are ofattributes in Key: carries
marks.7h Note :
Ans. key.relation Q6.following therelations. anomalies,
clearly orbaseclassified the
: Key relationships Aprimary
records.column A database
field orPrimary Distinctions
Keys
unitwqo uely examplAidentitye, Candidate The Keys :data. li It more A called a a database modification To
combination
records pri m ary for primary and relationalrelation. key What relation problem
DBMS
mustcannot Attempt and
mininmal each fields,
identiinfies Stud tuple a containcontaindesignated
The is Super key thatDBMS in Explain ? Questions) Answer
(Short If and
key, make
mai n key unique. key between Three will any schemas into of2020/ /
a record among database. Keys help
values. do Section B - modification
table No set
of in is is whose is Key candidate you operateanomalies sure
anomalies insertionupdate
afeature speci a a any
a one known of to al The value field Primary questions.
an Studentattributes
crecord unique null uniquely : differentuniquely are to an is the that so 125
have nore
or uniquely value or Individual alsouttribute difference mean Two
correctly. the that anomalies.
as values. of relational programs are anomalies. no
in val ue primary identifies combination for a questions areanomalies,
the fields relaCandi
ation.datewhich ineach Key, tables used key
by(2x Each
present. insertion,
same table, for identify the values identify and
present
These
whose can each key dat a base primary
that record Candidate and to or between a 7½ that note Design
key that establish question deletion
uniquely are al record. columnsin a set u super key = out update them deletion, in can
value. is, value key. row
t:able table key the two in of
key
a iuple
to 15] of the the be
no For of of
decomposed redundancy table. Loss-Less : this,
In decomposition Decomposition representediTIportat A Wher Ans. Q7.
dependeTt
EpioyeeiDFulName Empiovee
Lossiess saycan We Functional in SsperPrimary Canditate
Taking Saper
Kevs simpiy
ther g
This we this TunCtIOtai Fusctioæai Define S
can Hee
property
exampie. role onone Kes
tsbie
n be
compositiontables database from dependency sa y by znother attribute Kev in DepeiD FuName
EmpiyeeD.
SSN. eumpáe T
4gie feche
that
that,
is that deperdency X good infunctional Kes:Cantidat:
: esployee
f we
if is if ’Y. Dependescy we : Tsher S
RI th e Prinaryc
there called if we can add of
and wehelps
city,know Let's attribute.
datz
be choose tabie sn
R2 perform Employee103Mr. Emp id dependency. is any
lossless
we loss-less
101
Vinod I02 understand isbase
determined
super a ky Empleyee i es
the other
select by us denoted Functiona!
design. : either is kzy
Epigy
sai aken
that
using the to value the re cte
decomposition decompose RaviMrAshok
. Mr. key.
coluTN bte
thedecomposition. natural Name, Employee Name by indivitual
colunns eelD
Ermploy
common
Joins. of Functional Dependency by table
sthe ot
Even
Emp an another
What Tibute & butes(nmsÀ
otvey, a
join and arrow eefD SSN :sunNTentity
eY
the salary id, wecolumns
element it on we Dependency attribute, do or fieid
toSSNchoose re
key set
becomes We both table can *’*. mean Candidate for allows
cstoer isa
in are helps primary
a in
and decomposed use functionally to obtain 16000 14000 Salary
12000 th en columns, to th e which cante
The a
the easy the two us we by rnatnan tabie entity tOS
functional
indecomposecalled to UNIquely s can have
criteria functional smaller Employee Meerut loss-less key keys. thar sutticent
to MeerutLucknow DBMS Employeelbsaprererable set uniquely key
reconstruct table, depended ien quatto the
City that uiques custOmer. but
for tables. with t dentify
to an
identity
same
selecting dependency it Name, dependency one there
should decomposition
the
becoies
distinguish
example. attribute code.
The on table. cannot field
the city,
common returm mainEmployee a queness a
entity row a their
can
relationR to salary, ofX plays It is sper table. one
in
in reoing
be
removecondition the functionall custom the a more be
of tabl used
key
eleie original number. etc. on a ? choica Here all ent ih
from B) Vi ver lik e in the er
ie o! 10, te:Attempt
ansactions: ecutednction sually, ns. Transaction: ates oftansaction erations transaction
ngramming
language 5.
saly, marks.
ries 15 efine h
ogramming
Transactions
tread(),
hat
These
evenexecutingstarted,
Durability. Isolation.
"
for Atomicity.
Consistency.
concurrently)
" " To
ensure
between calls)
transaction Explain
a
A tion forms
of executed
between th
netion
e transaction
Transaction
a
What
Normal
omposition
functional common
every transaction a is
executed properties if integrity language transactions logical is calls)Transactions?
there or of is element of
whicaccess
h Tipair Even the ACID a of a : any dependencies
concurrentlyAfter started preserves
Either the is
process
the unit
is forms. relation
a
the are are of Execution of form is a unit example, (for
BCA
transfers though begin properties
(for initiated Three
system transactions al l th e unit of form must
begin initiated of
read data often a despite whose Vth
transactionexecution operations transaction data, example. program [Please
work List RSemester
operation. theusingcalled the of transaction program of[Please begin are into
he
failures. thein multiple we by failuresexecutionbegin
by Draw
a
questions
Questions) out
(Detailed
Answer
the candidate
a
data two the consistency a require a
is
SQL,COBOL. user Refer in RI
system. after Titransaction of SQL, ofRefer calledtransaction execution F*and
item ACIDcompletes transactions user a Section-C definition(Closure introduction /
operations and execution a transaction
- program state
7i the and transaction can Q21
tinished. Tj transaction COBOL.C.C-, that program TRANSACTION. either R2
.Y end and is key
from . of th e Q16 change that
diagram of Unit-VI
properties. successfully, appearsit the in transaction. end the and wTitten lossless-jon of a or
the : Thus, database. may isolation database
transaction. written that Unit-VT
entire C.C--.or
and end accesses following of
functionai super To
to first, DBMS
database ae accesses contents end in key
each executeto eflected system or in
with transaction transaction. a of Page-110| second
the (that high-level and in 2020 /
i Java). aPage-119]
high-level suitable
transaction.
A Java),transactions Five dependencies).
decompositioneither
to changes transaction that The and database of possibly
a concurrently, is, maintain /
a where
local either properly
with transactionwhere possibly DBMS.
executes data-manipulation
questions. Each and of 127
it
The relation
buffer has is Tj no data-manipulationthe language example.
it
is
or system transaction itupdates third
Adelimited showing is
made unaware finished the other following in deiimited updates collection if
belonging th e consists or normal atRl.
none must various
to ofsystem database,
transaction var
[3 least
R2
the execution
other of by of
ensure consists by its x one or
to database guarantees properties statements 0us of language data question
it operat statements
15= forms. both.
all states. of
the transactions executing none or operations data does.
proper of items. 45] the
transaction before Ttems. ions
persist, of al or
that, are. the (or
Ti
t28
ntrohon To BNS 020
6CA Vh Semes BCA Vth
AC.KL whch transt the dety itn fv the va! uter o1the iransactlon at actions have completed Semester/ IntroduetionTo DBMS / 2020 /
129
bak o the darahase N
to avoid the
This problem
fer the other. of
concurrently executing transactions is to execute
TIresd4Y
tansactin n However,
efits,they allow multiple concurrent
isolation property of atransactions
execution of transactions providestransactions serially--that
to exCcute significant perforniance
transaction concurrently
equivalent to a state thatensures
state that is
ine in some order.
that the
could have beenconcurrent execution of transactions results in a
obtained had these transactions
executed one at
B- B- $0. What areSchedules ? What are
write B)
CoRSStency : The consisten reguirement bere is that the sum of Aand Bbe unchanged by the execution
ew serializability ?
ns. Schedules: difference between conflict serializability and
of the transaction Without the consistency requirement, money could be created or destrovedh ndatabase
ransacton. It can be verified casily that, if the database is consistent before anexecution of the transaetianing parallelscenario, schedules define the order of
and order of operation is needed to execution of transactions. When many
the database remains consistent afer the execution of the transaction. Lo be set so that transaction
Atomicity :Suppose that, jus before the execution of transaction Tì the values of accounts Aand R scheduling
one and
play the important role for the same. Aschedule is aoperations
process of
do not overlap each other,
Rs.1000 nd Rs.2000. respectively. Now suppose that, during the execution of transaction Ii, a executing them in a predefined order.Aschedule is grouping the transactions
occurs thz prevents Ti from completing its execution successfully. Examples of such failures include failumetransactions execute in parallel, they mey affect the result of therequired
in a database because when
filures tardware faflures. and softwzre errors. Further, suppoSe tnat power undating the values which the other
transaction is
transaction - means if one transaction
CDeration but before the write (B) operation. In this case, the valuesuanPei
of accounts A and B
e wTite (4) 41 changethe result of second
transaction accessing. then the order of these two transactions
database ae Rs 9S0 and Rs.2000. The system destroyed Rs.50 as a result of this failure. Inreflected in the ference
sote that the sum A-Bis no ionger preserved. Thus, because of the failure, the statee of the particular, we between Conflict Serializability and View
system no longer Serializability :
refiects areal state of the worid that the database is supposed to capture. We term such a state an Conflict Serializability
sySiem must at some point be in an inconsistent state. Even if transaction Ti is executed to
inconsisternt
state Wemust ensure that such inconsistencies are not visible in adatabase system.Note, however that the 1fa schedule is view serializable then it might If aschedule is
or might not be conflict serializable
View Serializability
conflict Serializable then it is
tz:StS a poit at which the value of account Ais Rs.950 and the value of account B is Rs.2000. completion, there For a Transaction TIwhich is Writing avalue also a view Serializable.
which is If atransaction TI writes a value A that no
cieariyofan inconsistent state. This state, however, is eventually replaced by the consistent state where the X that no one else read but later some other other transaction read(because
valse account Ais Rs950. and the value of account Bis transactions say T2 write its own value of A, later some other
Rs.Z050. 1nuS, 1 asavo Gre siarted or w(A) can not be
was guaranteed to compiete, such an inconsistent state would not be visible uiG
transaction say T3 writes its own value of
except during the execution df placed under positions where A)W(A) can be placed in
the transact[on. Thast is the reason for the atomicity requirement: If the atomicity property is present. all it is never read. position of schedule
where it is never read
actuons of the transaction are reflected in the database, or none are. Conflict equivalence can be easily achieved by View equivalence is rather difficult to achieve
Durabiliry: Once the execution of the transaction completes successfuly, and the ser who iniatcd the reordering the operations of two transactions as both transactions should pertom simlar
saan
failure wilhas
resuitbecn
in anoified that curresponding
loss of data the Iransfer of tofunds has taken place, it must be the case that no syste achieve.
this transfer of funds.
therefore, Confliet Serializabiliy is easy to Serializability
actions in aissimilar manner. Ths, View
difficult to achieve.
The durability property guarantees that, once a transaction completes successfully, all the updates that it
carried out on the database persist, even if there is a system failure after the transaction completes executior12,
We assume for now that a failure of the computer.system may result in loss of data in main memory, but data
What are distributed database ?
written to disk are never lost. We can guarantee durability by ensuring that either ns, Distributed Database :
I. The updates carricd out by the transaction have been written to disk before the transaction completes 4 distributed database is a database that is under the control of a central database management
2. Information about the updaies carricd out by the transaction and wrilten to disk issuficient to enable(h. stem (DBMS) in which storage devices are not all attached toa common CPU. It may be stored in
database to reconstruct the updates when the database system is restarted after the failure. aultiple computers located in the same physical location, or may be dispersed over a network of
Isolation: Even if the consistency and atomícity properties are ensured for each transaction.if several terconnected computers.
ransactions are exccuted concurrently, their operations may interieave in some undeirable way nosuling in The distributed database can be defined as consisting of acollection of data with diferent parts
computers
an inconsistent state. nder the control of separate DBMS, Funning on independent computer systems. All the
For cxample,as above, the database is temporarily inconsistent while the transaction to tronsfer iunds ron einterconnected and each system has autonomous processing capability, serving local applcations.
Ato # is executing, with the deducted total written to Aand the of one or more global applications. Such applications
second concurrently running transaction reads A and Bat this yct to be written to B. If 4 ach system participates, as well, in the executiondatabase systems are capable of handling both local and
increased total yet
intermediate point and computes AtB, it will tquire data from more than one site. Distributed
observeonantheinconsiatent
based value. Furthermore, if this second transaction
inconsistent values that it rcad, the database may be left
then perorms undates on nd 8 obal transactions. The system resolves all local databases requests, access to data at other stes.
in an inconsistent state even alter bou
BCA Vth Semester /Introduction To DBMS /
130
tntroduction To DBMS / 2020/ 2020/ 131
BCA VIh Semester/ some of
rthe major problerms
Collections of data can be distributed1across multiplephysical
locations. Adistributcdd re are
database is distribbited emporary Update Problem : associated with
concurrent processing which are iisted below.
database may be replicated.
mo separate partitions/fragments. Each partition/fragment computers. All these one ransaction update a
In distributed sysiem the databasc is stored in several
with each other through one of various communication media such contains
computers communi
as high speed networl
When data itern and
cate rtransaction.this situation is called is fails to commit and this, but updated value is used by
or ther
temporary update problem.
lines. They do not share main memon ordisks.
a single remote node. Adistributed
Aremote transaction
transaction contains statements that
access
only
morementsonethteatlephone
statethan access TI
Read item(X) T2
node X=X-1;
Advantages of Distributcd Database : levels
" Distributed database can manage the distributed data with different of Write Item(X)
fragmentation transparency. replication transparency etc.
" It increases reliability and availability of data.
transparency like Read item(X)
" It iscasier for expansion of database. X=X+M
" Distributed database reflects organisational structure. Database fragments are
departments they relate to. located in the Iflet ussuppose transaction 1fails for some reason then
Write item(X )
Xwill revert back to its previous value, but
Distributed database makes posible the protection of variable data. If there ever acatastrophic nsaction 2has already read the incorrect value
event such as fire, allof the data would not be in one place, but distributed in multiple location
Distributed database ultimately proved economical. Infact it costs less to create a network. of Lost Update Problem :
computer with the power of a single large computer. smaller Mostly this problem occurs when two transactions tries for write operation on same database item in a
There is amodularity feature in distributed databases, it means systems can be modified. added.deaved manner that makes the item value incorrect.
removed from the distributed database without affecting othe: modules (system). Time Tx Ty
Disadvantages of Distribated Database Systems : TI READ(A)
" Extra work is to be performed by the daabase administrator. It has to ensure that distributed neh T2 A=A-100
of the system is transparet. Extra work must also be done to maintain multiple disparate svsta T3 READ(A)
instead of one big one. Extra database de:sign work must also be done to account for the disconnectd T4 A=A+100
nature of the database. TS WRITE (A)
" In distributed database, there is more complexity. There is more extensive infrastructure, so more T6 WRITE (A)
labour cost is involved therein.
" Remote database fragnents must be secured and they are not centralized, so the remote sites Unrepeatable Read Problem :
must different values are read for the
be secured as well. The infrastructure must also be secured. Inconsistent Access Problem that occurs when in a transaction, two
" There is difficuty to maintain integrity.as in adistributed database, enforcing integrity over a ame database item. having an
operations on account A,
may require too much of the network's resource to be feasible.
network Consider two transactions, Ty and Ty, performing the read'write
vailable balance =300 RS.The diagram is shown below :
" There is no defined standard for distri buted database. There are no tool or
users convert a centralized DBMS in to a distributed DBMS.
methodologies yet to help
TIME TK Ty
" Distributed database design is very ccomplicated besides of the normal READ (A)
difficulties, the design of a
distributed database has to consider fragmentation of data, allocation fragments READ(A)
to specific sites and T2
data replication. A=A+200
T3
" It requires additional software and operating WRITE (A)
system to support distributed environment. T4
" Concurrency control : it is major issue of distributed database, which requires locking T5 READ(A)
stamping for solution. and time different values of account A,
ie, 300
within the same transaction Ty it reads two unrepeatable read and is therefore
It means that 500. It is an
Q13. Describe the major prolTlem bytransaction Ty, it reads
example. associated with concurrent processing with Initially, and after updation made
problem.
Ans. Concurrent Processing means inuitiple Known as the Unrepeatable read
transactions
control it, this may lead to sO many p roblems. In data base are executing on same time. If we do
problems. scenario this nrohlem is called concurreiy
acA Vth
can
Semester
/Intr0duction DBMS /2021 / 133
To
that users
and
utilize it
making: for further queries and
data
Introduction To DBMS
actured
Normalization
the data
appear similar analysis This includes
across all records eliminating redundart
o
normalizing a
and fields.
Year - Dec. 2021 BCA-S01
procesS
of
or data
itádlizing,atabase database
has the
following
[Time. Three Hours) |Maximum Marks: 751 Dplication may be redundancy through normaladvant
eliminated. ization.ages:
normalizing, we may reduce null
Note : Aftempt sl questions as per instructions.
Resultsin asmaller database values.
This solution is provided by Mrs. Lipika Goel
Minimizelavoidissues with data(since there is less data
Section - A Unique Key Constraint : t
makesthe queries easier. modification. duplication or
zero).
Aunigue column constraint in atable is similar database structure is
more
(Very
Note Short any
: Attempt Answer Questions)
Two questions. Each a primary key in that the value in that column for
he
Exístingdata can be added to the database
and
without
comprehensible straightforward.
question carries 7.5 marks. Very short every row of data in the table must have a uniaue
pecaUS
he table is compact and more rows can fithaving an impact.
on the data page. finding, sorting, as well as
answer is required not exceeding 75 value. Although aprimary key constraint is plaçed indexing may be quicker.
on one column, we can place a
words. [2x 7.5= 15] unique constraint pata nnsistency Data consistency means that the data is always real and it is not
:
Q1. What is Functional dependency? on another column even through it tits not actually MData becomes non-redundant ambiguous.
Explain it briefiy. for use as the primary key. n Better performance.
Ans.

(Please Refer Q2 Unit-VI Page-99) Q4. Explain Hashing in brief. e Third Normal Form (3NFY
Ans. Arelation will be in 3NF ifit is in 2NF and not contain any
transitive partial depen-
Q2. What is Transaction? Explain it. (Please Refer Q22 Unit-II Page-59 3NPis used to reduce the data duplication. it is also used to achieve the data
fchere no transitive dependency for non-prime attributes, then the relation must
is inte_rta
Ans. be in t ri normal
05. Explain advantage of database for.
(Please Refer 09 2020 Page-127| management system over file orientedation is in third normal form if it holds at least one of the following conditions for every non-triviai
system.
Q3. Define Primary key, Not Null key and Ans. ction dependency X ’ Y.
Unique key constraints. Xis a super key.
Ans. Primary Key Constraints : (Please Refer Q25 Uni-I Page-22) Yis a prime attribute, i.e., each element of Yis part of some candidate key.
Primary key is the term used to identify one Ih other words, a relation that is in First and Second Nomal Form and in which no rh.t-primary-key
9r more columns in a table that makes a row of Section - B ribute is trangitively dependent on the primary key, then it is in Third Normal Form(?NE
the data unique. Although the primary key typically (Short Answer Questions)
consists of one coiumn in a table, more than one Note : Answer any One question out of . What are the pitfalls of lock based Protocol ?
column can comprise the primary key. For following Three questions. Each question s. Pitfalls of lock-based Protocois :
exsmple, either the employee's social security carries 15 marks. [1 x 15 = 15] Consider the partial schedule:
number or an assigned enployee identification Q6. Explain specialization and T3 T4
namber is the logical primary key for an'Empioyee generalization concepts in ER diagram lock-x(B)
Tabie'. read( B)
with suitable example. B= B- 50
Not Nai Key Coastraints : Ans. write(B)
lock-sA )
NOT NULL key is a constraint that we can place [Please Refer 09 Unit-II Page-35) readl A)
on a table's column This constraint disallows the lock-sB)
entrance ofNULLVALUES into a column. In other Q7. Why should normalization be lock-x(A)
T4 to wait for T3 to
release its
words, datz is reguired in a NOT NULL column performed on a table and what are t executing lock-s(B) causes its lock on A.
progress, T4to release
for each row of data in the tabie. NULL is generally benefits. Explain 3NF. Neither T3 nor T4 can makelock-x(A) causes T3to wait tfor 1ust be rolled back
and
tbe defaut for a column if NOT NULL is not Ans. Why should normalization be performed lock on B, while executingDeadlock.to handle adeadlock one of T3 and
specified, allowing NULL values in acolumn.
O 2 iable : Such asituationi is called Deadlocks are necessary evil.
Database normalization is a process in wh its lock is released. locking protocols.
existsin most
we modify the complex database into astmpler The probability of deadlock
database. It is the reorganizing data within 3
AVh Semester
penerally the pri/Imntaryroductkeyioofn theDBMS / 2021 / 135
To DBMS / 2021 / 134 is To
BCA Vh Semester / Introduction The keyfield
Index
valueinSecondary index may be
scOndary
every record, or a generatedrelfroma ation.
designed.
Starvation is also possible if concurrency control manager is badly
"A transaction may be waiting fot an X-lock on an ifem while a
sequence of other t.. tnasunique
request and are grante an S-lock on the same item
Index :
Chustering
MoT-key
field Clustering index is defined on an duplicate field
non-key with
values.
which is a
candidate key and
Ihe concurrency control manager can be designed to prevent
starvation.
Indexingis of two types :
ordered data fle The data file is
Section -C uged Index " Sparse lndex
Dense ordered on
(Detailed Answer Questions) Index:
Note : Answer any Two questions out of following Five questions. Each yuestion index, there is an index record for
carries 22.5 marks. 2% 22.5 =451 requires, more space to store every search key value in the
Q9. Write SQL Query for the following table: but
the
index records
actual record on the disk. itself. Index records database.
This makes searching
Employee (ENO, Ename, DOB, Address (City), Salary, Gender, DNumber) nerto contain search key valueand
China
Dept (DNumber, Dname, MEmpNo, M-Start date) China
Canada Bei
Ottajwaing 3.705.386
Canada
1. Display the age of 'male' employee. Russia 3,355,081
2. Display the name of highest salary paid 'Female' employee. Russia Moscow 6.592,735
USA
3. Display the name of dept. of Employee 'XYZ'. USA Washington 3.713,691
4. Display all employee belong to same address (city). SeIndexX;
5. Which employee is oldest manager in Company. sparseindex, index records are not created for every
Ahs. actual pointer to the data on search key. An index record here
Employee (Eno., Ename, DOB, Add ress(city), Salary, Gender, DNumber) ch key and an the disk. To search a contains a
d reach at the actual location of the
record. we first proceed by index
Dept (DNumber, DName, MEmpNo, M-Start date) brd and data. If the data we are looking for is not where we
Hby followingtheiindex, then the system starts sequential search until the desired data is found. directly
1. Display the age of male employees.
Seiect Enc. Ename. datediff YY, DOB.getdate()) as age from Employee where Gender- Male'. China China Beijing 3,705.386
2. Display the name of highest paid female' employee. Russia Canada 3,355,081
Ottawa
SELECT a.Ename FROM Employees aWHERE a.Salary =(SELECT MAX(Salary) FROM Emploee USA Russia Moscow 6.592.735
WHERE Gender- Female'); USA Washington 3,718.691
3. Display the name of the dept of employee XYZ'. Jtilevel Index :
Select d.DName from Dept 4, Employee e where d.DNumber. =e.DNumber. and e.Ename=XY. dex records comprise search-key values and data pointers. Multilevel index is stored on the disk along
4. Display all the employee belong to same address(city) hthe actual database files. As the size of the d¡tabase grows, so does the size of the indices. There is
Select Eno., Ename. Address From Employee
nmense need to keep the index records in the main memory so as to speed up the search operations.
Where Address In (Select Address From Employee Group By Address Having Count(*) >|) mgle-level index is used, then a large size index cannot be kept in memory which leads to multipie disk
5. Which employee is oldest manager in Company. eSses.
SELECT " FROM Employee e, Dept dWHERE d.M-Start Date =(SELECT MIN(M-Start Da:e)
FROM Dept ) and e.D Number d. DNumber:
Data Blocks

Inner Index
Q10(a). Why the concurrency control is needed ? Explain it.
Ans. Data Blocks
Outer Index Inner Index
(Please Refer Q1 Unit-VM Page-114]
Q10(b). Describe different method of Indexing. Inner Index
Ans. Indexing : Outer Index
Data Blocks
Indexing is a data structure technique to efficiently retrieve records from the database files buseu
some attributes on which the indexing has been done. Inner Index
Indexing is defined based on its indexing attributes. Indexing can be of the following types :
" Primary Index : Primary index is defined on an ordered data fle. The data ffle is ordered on a key Data Blocks
er

SomagA/rtti ro DBMS /
2021/36 regate
Description
Introduction To DBMS /2021 /
137
SCA
Mutt-kevel index helns in beaking down theider into severalsmaller indices in order to mak yactlons
0t returns the
Syntax
the data values.,average Example
of
disk block, which can
casiy
he the SELECT AVG SELECT Output
Dutermst level so small that it can he savdin asingle
accommo atet <column
FROM name> AVG(Sal
16800 ary)
atywhere in th main e y
five aggregate AVGISalEmployee:
<table name> FROM ary)
Q11. What are the characteristics of SQL? Discuss the
suitable example. function vlth AX
It returns the
maximum
value for a column. SELECT MAX SELECT
Ans, Chsracteristics of SQL :
to write queries. lt was
<column name> MAX(Sal
30000 ary)
Structured Query Language (SQL) is astadard Ianguagewas declared as a standard developed lounderuse FROM MAX(Salary)
<table name; FROM Employee:
RProject by l8M. SQOL has a basic grammar and syntax.
by American Standard National institute (ANS) and
Intermational Standard
plattorms.
language
Onganization (|S0),The eKN
t returns the
minimum
value for a column. SELECT MIN
SELECT
tunctionality ofSQL kanguae is virtually sinilaracross the operating system <column name> MIN(Salary) MIN(Salary)
SQL is casy to learn.
SQL is used to access data from rlational databAse management sYstems.
FROM
<table name>; FROM Employee.
4000

It returns the sum


> SQL can execute queries against the database. SUM SELECT SUM
SQL is used to describe the data. (addition) of the data <column name> SELECT SUM(Salary)
SQL is used to define the data in the database and manipulate it when needed.
values. FROM SUM(Salary) 50000
SQL s used to create and drop the database and table. <table name>; FROM Employee WHERE
SQL is used to create a view, stored procedure, function in a database. City-Pune';
P SQ allows users to set permissions on tables, procedures, and views. COUNT) It returns total number SELECT SELECT
> Portability of databasedefinition and application is also provided. Applications can be moved of values in a given COUNT COUNT(Empid)
one machine to another. column.
<column name> COUNT(Empid)
FROM Employee,
IS professionals share acommon language and reduce training costs. FROM
Professionals can become proficient in its use and increase the productivity. <table name>;
Itprovides with longevity.
> It provides with reduced dependence on single vendo. 2 Define E-R Diagram. Draw on E-R Diagram for library management system,
Aggregate Functions : relevant entities and attributes for the library management system.
>Aggegate functions perform acalculation on a set of values and return a single value. ns. Entity Relationslhip Diagram :
} Aggregate functions ignore NULL values except COUNT. An Entity-relationship model (ER model) describes the structure ofa database with the help of a
> It is used with the GROUP BY clause of the SELECT statement. liaram, which is known as Entity Relationship Diagram (ER Diagram). An ER model is adesign or
Following ate the Aggregåte functions : Mueprint of adatabase that can later be implemented as adatabase.
1. AVG . Itisahigh-level data model. This model is used to define the data elements and relationship for a
2. MAX specified system.
3. MIN " It develops a conceptual design for the database. It also develops a very simple and easy to design
4. SUM view of data.
entity-relationship diagram.
S. COUNT) " In ER modeling, the database structure is portrayed as adiagram called an
Example : Component of ER Diagram :
ER Model
<Employee> Table
Eld Ename Age City Salary
E001 ABC 29 Attribute Relation
Pune 20000 Entity " One to one
E002 PÌR 30 Weak Entity " Key Attribute
Pune 30000 " Composite Attribute " One to many
EO03 LMN 25 Mumbai S000 " Many to one
" Multivalued Attribute
E004 XYZ 24 Mumbai 4000 Many to many
" Derived Attribute
E00S STU 32
Bangalore 25000
Aas.Q13.

lastName irsname
Explain Stafi id DisgramERof
Boo " " "
info. WIthin eTttnes "The
Stafi ReadersApubltsher
Readers
(firstno story
password
Staff The
Phoneno Retun
ssue Library
three Email also the \ Svstem
name
Regno allowed. are edihon, maintans
prescribed can
ddress A generate Management
level retunRgsterd has keeps Library
Mansgement
er
suthr the
publisher
architecture Readers rackof communication
reports tra
(Please Keeps Saf Manages Reports reserve
time Number o¢
CA SCA
M with of
Svsiem
eriod,
that Id. catalog the Vh
bosthat thcr
Refer has
Year staffwitha Semester/
ant

of return eserve/returm 1 readers mav


itaddress user when details. withits datahase
ISBN,
923 DBMS. ReserveDate
System
tntroctior
maintain havestamns email, d. the single keers
date id, The
Unit-I date Login registration due a stafl
hok
track
Due
date with nane was authentrcation title. loginoint
Book
Page-18| Password datetoo. keeps
issue published. of To
<Publishes |Publisher readers DBMS/
N
no date track
Authentication of name, priceqin
AuthNo
report, of 2021/
system and and
last
category(novel.
readers. INR). system n
Books Publisherid name
return 138
1SBN name Loginld booK name), ,
YearOfPublication of cOmprisino
Title) no date. Phone the
and g
Edition)Category Price book
not If considerat,,ar
returo/.
returned (multiple
genrat land

: ity cntitycontainstudent atribute


For entities. An EntitySetutributes
:onsidered
eachers, Ror ue
ote
exampleFor Cht ientifiable.mimate entityEntity:nAns.What03, Please DS.
sets issets example,
al of
sharing
similar
values. An
entity example,
orclasses
eneralization? (Plmanagement
easReefer atabvarious
ase iAWhat etmptAns(VShorewryert
What is instructsoluquest
This
itoiAtons.ntemptions
need the a
collection teachers a school.
set entity properties
is
as
entities. inanimate, can
or
Entity
is
Kefer areofSection -A :ThrHoure s|
not a is
be student collection set a and a
in be all
provided Dec.
09 questions.
disjoint. Likewise ofa may
All school real-world Set?Specialization
that courses 2022
of school set contain give these
that Unit-ll Unit-Iapplications
:system? Sachan by
from
morethan database,
amay of thementities Questions) Mrs. Introduction
DBMS To
teachers
form similar offered canobject,
be sections all
al
contain entities their Page-35) Page-6] [3
x Beena
one have students, 5
entity. faculties. set type identity. can easilyeither = as
may ath!le with some
be and 15] per
of
mappinrelationships.
g,one-to-one
departservement at Or an Thererelation
although through cardinality Ans. Q4. entity.
isentities Second
2. Exsmple: Surgeon most we entity 1. 4.One-to-One 3. 2. 1.
cardinality most In One
One-to-one: a What
One-to-many: an
one can
Many-to-Many
say in
One-to-Many
Many-to-One are4 sets theyuseful adatabase, to
Mapping
entityentity
has unit A types certainwhich ratio are
entity In that is containing
can in set
one a connected
or to
at Cardinalities set
in particular
A
is In
head Headedby
(EEE) item unit a this In
cardinality
cardinality
cardinality
of describing
contribute relation
cardinality mapping,cardinalities? another
means the
the
contain
contain
|Maximum
Marks:75)
associated this of
in or type
A.item
more mapping
to e, BCA-501
set. denote
depart
type ment .
hospital, most
cardinality
in
of
) than binary
(m:1) (1:n) (1:1ratios to
Mapping
entity
: e,
e
and
e,
B
B (m:n) the
with of isone two cardinality
can the eentity,
ef
the connected description
: relation
cardinality They
any HOD
entity
mapping.
entity cardinality number be ey
number surgeon linked and
while
both in sets. sets, ezo
to B. of of or
BCAVth
SomoSter 7Introduction To DBMS /
140 Key. :Primary key is one ol the 2022 / 141
introductlon To DBMS / 2022/
BCA VIh Semoster / mary
table. Primary key must contain candidate key, which is most
Ewample: In aparticular conipany. nultiplc heof table, unique values, must never beappropriate to be main
of entitices in B. Or we can say that one unitor item in
work on multiple projects. They serve din
For
the
example
:
null and reterence
uniquely identify
B can be connected to at most one unitor item in A.
relationships. many-to-nany Candidate key -’ Student id,
eacn

Q5. Describe weak entity set in Primary key -’ Student id


FName, LName
Ans.
brief. Frelgn Key : Primary key of one table is known as
a2
(Please Refer Q8 Unit-II sent
inanother table. In other foreign key of another table when that
words, if we had two tables
Page-34]
a

primary key of tableattribute


linkedIto table N where X was a Mand N. Xis a
84
Section - B He M fe X would be a
foreign key in N.
Mand

(Short Answer Questions) Student id FName Lname


Note: Attempt any two questions,
Sungeon Has
M
Doctors (7.5 %2 = 151 0001 Sandy Sharma B.i Relationship aPrimary key
Department Rohan
Example: In aparticular hospital, the surgeon
Q6. What is Key? Explain
of Keys. different types
0002
0003 Amit SharmaB.
Goel TechMBA(EC) Course Duration
B.Tech (EC) 4 years
department has multiple doctors. They serve one-to Ans. Keys :
0004 KumarBhardwaj MCA MBA 2 years
many relationships. We know that database uses tables to Sonu
MCA 3 years
3. Many-to-one: In this type of cardinalitymapping, information. To maintain data integrity (thatorgani
is dze
0010 Agarwal B.Tech (CS) B.Tech (EC) 4years
an entity in A is connected to at most one entity in B. Table N
should be correct and in welllformed) we use Table M
Or we can say a unit or item in B can be associated of 'keys'. Atable in a database may concept
with any number (zero or more) of entities or items be
empty, 7.Comparethe BCNF and 3NF in brief,
containing
them, no records
Similarly, asingleorrecord
containmaymanyconsist
millions of ns.The main difference between 3NF and BCNF is that the table should be in 2nd normal form and there
of. One
in A.
B orthousands of fields. Each field in turn Containsa houldn't be any transitive dependencies to satisfy 3NF while the prime attributes of the table should not
=(E) single item.table,
In order on the non-prime attributes of the table to satisfy BCNF.
record data
of the thereto must
uniquely
be someidentifyfieldeacho epend
Data redundancy refers to the same data repeating in multiple places. It can also cause issues in data
combination of fields. Each should have only unin eertion, update and delete. Normalization is the process of organizing data into multiple related tables.
values. INF versus BCNF:
b3
3NF BCNF
Types of Keys :
Anomal forn that is used in nomalizing a databaseA normal form used in database nonalization,
Super Key : A super key is any combination of of the 3NF.
design to reduce the duplication of data and ensure which is a slightiy stronger version
Multiple Sugeries
M
done by S1ngde Surgeon fields within atable that uniquely identifies each record referential integrity by ensuring that the entity is in
within that table. second nomal form and all the attributes in a table are
Example: Ina particular hospital, multiple surgeries Candidate Key :A candidate is a sub set of asupcr determined only by the candidates keys of that relation
are done by a single surgeon. Such a type of key. Candidate key is a single field or the least and not by any non-prime attributes.should The prime aitributes of the table should not depend
relationship is known as a many-to-one relationship. combination of fields that uniquely identifies each The table should be in 2nd normal form, and there on the non-prime attritbutes of the table
to satisty.
any transitive dependencies to satisfy 3NF.
4. Many-t0-many: In this type of cardinality record in a table. Every table must have at least ong not be
mapping, an entity in Ais associated with any number candidate key or several candidate key. For example: structuralconstraints?
of entities in B, and an entity in Bis associated with Primary key Candidate key Q8. What are the relational and are concepts commonly used in the context of databases and data
structural constraints
AnS, Relational and
any number of entities in A. between
modeling. that govern the relationships certain
Student id| FName Lname Course
Constraints: Relational constraints define the rules
consistency of the data by enforcing
Kelational and
0001 Sandy SharmaB.Tech (EC) database. They ensure the integrity
oles in a relational constraints are: unique identifier,
0002 Rohan Sharma B.Tech (EC) common relational
row in a table has a
0003 Amit Goel MBA conditions. The MostConstraint: This constraint ensures that cach or null values in the primary key
rimary Key IL prevents duplicate
a h
0004 Kunmar Bhardwaj MCA
uniquely identify that row.
Which is used to one table that refers
to the primary key
of
0010 Sonu Agarwal B.Tech(CS) column. key isa column foreign key column match the
Constraint: A foreign ensures that the values in the
roreign Key constraint
Emlonees Woks oa MMdtupie Proyccts Sharma B.Tech(S) The foreign key nul.
O100 Sareen alother table.
primary key column or are
Yaluesin the referenced
nCAVIth
Semoster /Introduction To DBMS I
employces in(ntn bAse 2022 / 143
all
olectemployee-name who do not work for frst Bank
that mus! l
omemployee
enmployee-name NOT IN ( Corporation.
bNiN siluN 9 t e fitte a YViion
satistied fo where
temployee-name
Works
that definc om company-name-
database is well First Bank
Where
): Corporation'
entityostraints
(able) cannot are Findthe company
that has
the most
C a t : hix w sUNS hat the nelationshis company -name employees.
ha hrgn kÇi vshxs in atsble match the primarybetween
Irteg
mainiaiNNw hgu tatblesin the
key valucs works group by company-name
MVingcoun(distincttemployec-name) >= all
" omaìr <`orsìnt ¢imsin ntsiN Nte emiSe \alues tor aparticular attrih.cOunt (distinetemployee-name) from yorke.
group by company-name)
liminate data Explain data models in detail.
radundsancy and imprave
and nomnalizao
(Please Refer Q28 Unit-I Page-26|
Whatis Relational Model? Explain collision in brief.
Relational Model :
Section - c The relational model is a conceptual framework used in database management systems (DBMS) to
(Detaied Answer Questions) Me and structure data. It was introduced by E.F. Codd in the 1970s and has
(15 x 3 =4) since become model
database management.
siiah emn ata e where theprimary keys are underlined, G i t erelational model, data is organized into tables, which are also referred to as 'relations'.
he n r S n o the fowing quarTies
ble consists of rows (also known as tuples) and columns (also known as attributes).
The rows represent individual records or instances, wkile the columns represent the diferent
sewgiye Onaymme salary) iutes or properties of those records.
The relational model is based on the following key concepts :
.Relations: Tables in the relational model are referred to as relations. Each relation has a unique
residene of all employees whose work for frst name and consists of rows and columns.
Attributes: Columns in a relation are called attributes. They define the properties or characteristics
tad ad ctyof residence of all employees whose work ofthe data being stored.
tar frt Bank CorO and earre than RS 10,000/ instance and
Fnt al engiiSata basewo do aot work for first Bank Corporation. Tuples: Rows in a relation are called tuples. Each tuple represents a specific record or
F h e o t t a s ne ost empioyees. contains values for each attribute.
within arelation. Aprimary key is aunique identifier
" Keys:Keys are used to uniquely identifjy tuplesrelationshiFs between difYerent relations.
for each tuple, while a foreign key establishes associations between different relations.
Relationships: Relationships define the connections or
through the use of primary and foreign keys.
These relationships are Iy pically established
where two or
collision refers to a situation
and data structures, to the same location,
athe context of computer science data structure) are mapped
table (or hash-based
eelements ofahash
nN aS ahash collision'. in an array. However.
elements to specific locationsproduce
hashing function'to map data the same hash
nash tables use a data elements to
functions, itis posible for different
lue to the nature of hashing
To DBMS / 2022 / L144
5CAVth Semester /introd°ction

value. esulting nceds to hodl


in a When a collision occurs, the hash table it appropriatty
to
coliision.
cnsure correct storare and etrievul of daTd.
Colliston resolution techniques aimto minimize the impNCtof collisions on the efticiencv
and Vear- Dec. 2023
Introduction To DBMS
ofhash-based data structures. By handling coilisions eftectively. these structures can stil
reliable access to data, even in the presence of collisions.
1here are various methods to handie collisions, including :
ll
pertofastrmancead
provide Time: Three Hoursl
Attempt
BCA-501
questions from all |Maximum Marks: 75|
Separate Chaining: In this method, each slot in the hash table contains alinked
or list Oeolution is provided by Mrs.sections as per instructions.
Beena Sachan
structure that can store mulinle elements with the same hash value.
Open Addressing: With open addressing. the hash table looks for the next available another data
when a collision ccurs, and places the element there. This process continues
found. until anslotempty slot
(probing Section - A
short set and one or more
iower level
(Very Answer Type Questions)
Robin Hood Hashin: This is a variation of open
addressing wnere elements are Attempt all
questions. Each question Following are the nrain point ofentity sets.
minimize the displacement caused by collisions. It ensures that elemnents with shorter rearraNote carries 3 marks. Very short between the two : diference
uired not exceeding 75 words.answer
r is
are placed earlier in the sequence. probe distane 1.
Generalization is the result of tak ing
the union
[3 x 5 = 15] of two or more lower
Q1. Define level entity sets to
Q12. What is Hashing? Describes hashing functions in detail. System.
Database Management produce a higher level entity sets. Whereas,
Ans. Ans. Specialization is the results of taking
of a higher level entity subsets
set to form a lower
(Please Refer Q22 Uni-III Page-59) (Please Refer Q3 Ünit-I Page-5] level entity sets.
2. In
Q13.Give the architecture of DBMS and their 02. List any five applications of DBMS. Generalization, each
also be alower leveihigher level entity must
Ans. Architecture of DBMS characteristics. entity. Whereas, in
Ans. Specialization. some higher level entities may
(Please Refer Q23 Unit-I Page-18] Please Refer Q5 Unit-I Page-6] not have lower-level entity
sets at all.
3.
Characteristics of DBMS : 03. What are the limitations of File Specialization
whereas
is a Top Down
process
Processing System ? Generalization is Bottomn Up
(Please Refer Q19 Unit-I Page-13] process.
Ans. For Example
JPlease Refer Q13 Unit-I Page-9)
Bank Account Specialiatior
Q4. Define Data Model.
Ans.
[Please Refer Q28 Unit-I Page-26] Current Account Saving Account
Q5. What are Attributes? Give examples.
Ans.
Q7. Explain the Primary key, Foreign key
(Please Refer Q2 Unit-II Page-31] and Super key.
Ans. Primary Keys :
Section - B |Please Refer Q16(i) Uni-ll Page-431
(Short Answer Type Questions)
Note :Attempt any two questions out of the Foreign Key
following three questions. Each question (Please Refer Q16 (ii) Unit-IIPage-44/
carries 7.5 marks. Short answer is required
not exceeding 200 words. [7.5 x 2 = 15] Super Keys :
A super key is a set of one or more attributes
Q6. Compare Generalization, (columns), which can uniquely identify a row in a
Specialization with example. table. lt is a set of one or more attributes, that taken
Ans, Generalization and Specialization are important collectively, allows us to uniquely identify an entity
relationships that exist between a higher level entity in the entity set. For example. social security
BCAVth Semester /
OCA Vth Semester
/Introduction To DBMS/2023 / 146
Introduction To DBMS / 2023 / I 147
Describe the
attribute of the entity set customer is sufficient to distinguish one customer entity from tabaselanguage.
classification of
SOCial security is a super kev
Taking an example of an
for the entity set customel
Employee table
another. Th nguage
isSOL?
Classificationof
Which type
Database Languages :
of revoke permissions to users and roles. DCL
(Data Control Language) is used for
controlling access to data and database objects.
Employee( lannguagesareespecialized and For Example: DCL commands are GRANT,
designed to interact with programming
natabase
EmployeelD. manage REVOKE.
FullName.
SSN,
MeuAges
abases. They cover various aspects of database 5. Transaction Control Language (TCL):
DeptlD
erstions, from defining the structure of the TCL is used to manage transactions in the
)
sbaseto manipulating and querying data, database. It ensures that database operations
grollingaccess,and managing transactions. are executed in a secure, consistent manner,
Candidate Key : Candidate key are individual columns in atablethat qualifies for
rows. Here in employee table EmploveelD &SSN are Candidate keys.
Primary Key : Primary key is the columns we choose to maintain
untqueness
Employee table we can choose either EmployeelD or SSN columns, EmployeelD isaa in a table, H
runiqueness
of all th
yiding
Sach
pose
ypeofdatabaselanguage serves aspecific
i
innmanaging andinteracting
flexibility and control over data
operations
with databases,
maintaining data integrity. TCL(Transaction
Control Language) is used for managing
transactions to ensure data integrity. For
Super Key : If we add Iany other column/attributeto a primary key then it becomes
EmployeelD FulIName is a super key.
+ a preferable choiçe
access. The choice of language depends on
super key lika sedandthe requirements of the application or
eddatabase management system (DBMS) being
Example: DDL commands are COMMIT,
ROLLBACK, SAVEPOINT.
6. Procedural Language (PL): Many
Q8. What is with the database. RDBMSs extend SQL with procedural
Ans, Normalization ? steminteracting
Following capabilities, allowing for more complex
types of database languages :
re mainoDefinition Language programming constructs like loops,
(Please Refer Q1 Unit-VI Page-99]) (DDL): DDL is
conditionals, and procedural logic directly within
eed to define and manage the structure and
the database. PL (Procedural Language) are
Section - C oohenma of a database. It involves commands
that create, alter, and delete database obiects used for writing procedural code and logic
(Long Answer Type Questions)
Note :Attempt any three questions within the database. For Example: (PLSQL,
15 marks. Answer is required
out of the following five questions. Each Hke tables, indexes, and views. DDL (Data
in detail. question cari PL/pgSQL, T-SQL).
[15 x 3= 451 Definition Language) is used for defining
Q9. Draw an ER diagram for a small and modifying the structure of the database. Conclusion :
own data requirements. marketing company database, assuming vo Each type of database language has a specific
For Example: DDL commands are
Ans. ER diagram for a Small CREATE, ALTER, DROP). role in managing and interacting with databases,
Marketing Company : Providing a comprehensive toolkit for database
). Data Manipulation Language (DML):
SCx
binh date DML 0s used to manage and manipulate the administrators and developers to effectively handle
name budget all aspects of database operations.
(relationship (name
location data within database objects. It includes
DEPENDENT commands to retrieve, insert, update, and Which Type of Language is SQL:
|PROJECT delete data. DML (Data Manipulation SQL (Structured Query Language) is a
start date hours Language) is used for managing data within comprehensive language used for interacting with
N database structures, For Example: DML relational databases. It encompasses several types
DEPENDENTS commands are SELECT, INSERT, UPDATE, of database languages that cover a wide range of
binh date OF
WORKS start date DELETE. database operations. Following are the points
status
Sex M <Assigned to> 3. Data Query Language (DQL): DQL is a explaining how SQL fits into the different types
subset of DML focused specifically on of database languages:
salary EMPLOYEE querying the database to retrieve information.
KEMPLOYEE 1, Data Definition Language (DDL) :
address The primary command in DQL is SELECT. SOL includes commands that define and manage
name DEPARTMENT DQL (Data Query Language) is a Subset the database structure. DDL statements are used
tis ame of DML focused on querying the database. tocreate, alter, and delete database objects such as
Cmiddie nam
last name <MANAGES name For Example : DQL commands is SELECT. tables, indexes, views, and schemas. Key DDL
location 4. Data Control Language (DCL): DCL is commands in SQL include:
SupervisionStart date)Cnun1ber of employee used to control access to data and database CREATE: Creates a new table, view, index,
objects. It includes commands to grant or or other database objects.
ROLLBACK
SAEPOI: quering
it
making with Page-25)
Extensions
with T-SQL of
(Transact-SQL)
for Independence
PUpgSQL
for
PostgreSQL type manipulating. Unit-IV
s a transactionSQL
the
back
language
single a
database
access.
Unit-I of UnitH
a which complex
capabilities following functions
provides
/14aSets TO 6.Procedural
Language
extend Q17 database Q27
SAVEPOINT
to
a
to versatile itsrelational (Ö) DDL(ii)
DML Q15
command
command
2023 performed.
transaction more
RDBMSS for
Oracle. Server. 1not
SQL limited
is and
It defining, the Refer Data Refer Refer
savepont. PLSQL categories. systems
(RDBMS).
D8MS/ forinclude: a data the
administrator?
These is
Conclusion
: of Explain Explain are
but for controlling
Cornerstone [Please (Please
Whoare (Please
Many language
tools
To
introduction SQL multiple Q11. Ans. types.
Q12. Ans. What
Q13.
of Ans.
database
existing
antable
newobjecttabie database
t dataused
DMLKey trom a deletes
table. the
in on command to usedDCL users granted during made
andinclude:
transactions
deletions.
/Semester ato database
a
from : manipulating
(DML)are data. data
table.
records solely from access
column aofthe statements a
fromor
conditions. are Key to
privileges
(TCL)integritymade changes
delete retrievesa
to DQL data manage
statements previously SQL
genxistig
rowsrowname updates,: focused
existingrecords (DCL): permissions. roles. manage transaction.
Language records (DQL)primaryquery Language datain changesall
VIh all individual
for andinclude: certain commands
BCA Removes and that specific or
a
ALIER
Modifies RENAME
Changes commandsupdate,Queries newModifiesRemoves
tables. Inserts,
DML
Language to Language DCL users to ensuring
Removes all
the
current
transaction.
Reverts
adding
DROP
Deletes
an the commands include: commands
Manipulation
objects.SOL Adds
on Used fromControl Saves current
logging based of SQL, revokeGives
database. TCL ROLLBACK:
TRUNCATE: more database,
like in SELECT: UPDATE:
insert,
commands INSERT: DELETE: MERGE: subset In
SELECT: Control
database.
REVOKE:
SQLGRANT: privileges COMMIT: the
database
provides Query
records includes roles.
or Transaction Key
object, withoutobject. or table. data. provides
retricve, one a andandin consistency.
during
DataSQLwithin is
DataDQLquerying commands the
Data datagrant
DML SQL SOLwithin
2. to 3. is: 4. the to 5.

You might also like