dbms pyq
dbms pyq
(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
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