0% found this document useful (0 votes)
1K views76 pages

Gate Questions: Database Management Systems

1. The document provides information about GATE questions prepared for the Database Management Systems subject for the academic year 2019-2020. 2. It includes questions from previous GATE papers from 2000-2019 on topics related to the Database Management Systems syllabus, organized by topic with the number of questions and page numbers for each. 3. The topics covered include Relational Algebra, SQL, ER Diagram, Normalization, Transactions, and File Structure. Assessment reports are also included to record the student's performance on the questions.

Uploaded by

Sudhir Sharma
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)
1K views76 pages

Gate Questions: Database Management Systems

1. The document provides information about GATE questions prepared for the Database Management Systems subject for the academic year 2019-2020. 2. It includes questions from previous GATE papers from 2000-2019 on topics related to the Database Management Systems syllabus, organized by topic with the number of questions and page numbers for each. 3. The topics covered include Relational Algebra, SQL, ER Diagram, Normalization, Transactions, and File Structure. Assessment reports are also included to record the student's performance on the questions.

Uploaded by

Sudhir Sharma
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/ 76

DEPARTMENT OF INFORMATION TECHNOLOGY

GATE QUESTIONS

DATABASE MANAGEMENT
SYSTEMS
2019 – 2020 EVEN

Question Paper Years


2000 to 2019

Prepared by

R. Arthy, AP/IT

NAME OF THE STUDENT :


CLASS : II IT
GATE SYLLABUS
Section1: Engineering Mathematics
Discrete Mathematics: Propositional and first order logic. Sets, relations, functions, partial orders
and lattices. Groups. Graphs: connectivity, matching, coloring. Combinatorics: counting, recurrence
relations, generating functions.
Linear Algebra: Matrices, determinants, system of linear equations, eigenvalues and eigenvectors,
LU decomposition.
Calculus: Limits, continuity and differentiability. Maxima and minima. Mean value theorem.
Integration.
Probability: Random variables. Uniform, normal, exponential, poisson and binomial distributions.
Mean, median, mode and standard deviation. Conditional probability and Bayes theorem.
Computer Science and Information Technology

Section 2: Digital Logic


Boolean algebra. Combinational and sequential circuits. Minimization. Number representations and
computer arithmetic (fixed and floating point).

Section 3: Computer Organization and Architecture


Machine instructions and addressing modes. ALU, data‐path and control unit. Instruction pipelining.
Memory hierarchy: cache, main memory and secondary storage; I/O interface (interrupt and DMA
mode).

Section 4: Programming and Data Structures


Programming in C. Recursion. Arrays, stacks, queues, linked lists, trees, binary search trees, binary
heaps, graphs.

Section 5: Algorithms
Searching, sorting, hashing. Asymptotic worst case time and space complexity. Algorithm design
techniques: greedy, dynamic programming and divide‐and‐conquer. Graph search, minimum spanning
trees, shortest paths.

Section 6: Theory of Computation


Regular expressions and finite automata. Context-free grammars and push-down automata. Regular
and contex-free languages, pumping lemma. Turing machines and undecidability.

Section 7: Compiler Design


Lexical analysis, parsing, syntax-directed translation. Runtime environments. Intermediate code
generation.

Section 8: Operating System


Processes, threads, inter‐process communication, concurrency and synchronization. Deadlock. CPU
scheduling. Memory management and virtual memory. File systems.

Section 9: Databases
ER‐model. Relational model: relational algebra, tuple calculus, SQL. Integrity constraints, normal
forms. File organization, indexing (e.g., B and B+ trees). Transactions and concurrency control.

Section 10: Computer Networks


Concept of layering. LAN technologies (Ethernet). Flow and error control techniques, switching.
IPv4/IPv6, routers and routing algorithms (distance vector, link state). TCP/UDP and sockets,
congestion control. Application layer protocols (DNS, SMTP, POP, FTP, HTTP). Basics of Wi-Fi.
Network security: authentication, basics of public key and private key

ii
CS8492 DATABASE MANAGEMENT SYSTEMS L T P C 3 0 03
OBJECTIVES

 To learn the fundamentals of data models and to represent a database system


using ER diagrams.
 To study SQL and relational database design.
 To understand the internal storage structures using different file
and indexing techniques which will help in physical DB design.
 To understand the fundamental concepts of transaction processing-
concurrency control techniques and recovery procedures.
 To have an introductory knowledge about the Storage and
Query processing Techniques

UNIT I RELATIONAL DATABASES 10


Purpose of Database System – Views of data – Data Models – Database System
Architecture – Introduction to relational databases – Relational Model – Keys – Relational
Algebra – SQL fundamentals – Advanced SQL features – Embedded SQL– Dynamic SQL
UNIT II DATABASE DESIGN 8
Entity-Relationship model – E-R Diagrams – Enhanced-ER Model – ER-to-Relational
Mapping – Functional Dependencies – Non-loss Decomposition – First, Second, Third
Normal Forms, Dependency Preservation – Boyce/Codd Normal Form – Multi-valued
Dependencies and Fourth Normal Form – Join Dependencies and Fifth Normal Form

UNIT III TRANSACTIONS 9


Transaction Concepts – ACID Properties – Schedules – Serializability – Concurrency
Control – Need for Concurrency – Locking Protocols – Two Phase Locking – Deadlock –
Transaction Recovery - Save Points – Isolation Levels – SQL Facilities for Concurrency and
Recovery.

UNIT IV IMPLEMENTATION TECHNIQUES 9


RAID – File Organization – Organization of Records in Files – Indexing and Hashing –Ordered
Indices
– B+ tree Index Files – B tree Index Files – Static Hashing – Dynamic Hashing – Query
Processing Overview – Algorithms for SELECT and JOIN operations – Query optimization
using Heuristics and Cost Estimation.
UNIT V ADVANCED TOPICS 9
Distributed Databases: Architecture, Data Storage, Transaction Processing – Object-based
Databases: Object Database Concepts, Object-Relational features, ODMG Object Model,
ODL, OQL - XML Databases: XML Hierarchical Model, DTD, XML Schema, XQuery –
Information Retrieval: IR Concepts, Retrieval Models, Queries in IR systems.
TOTAL: 45 PERIODS
OUTCOMES:

Upon completion of the course, the students will be able to:

 Classify the modern and futuristic database applications based on size and complexity
 Map ER model to Relational model to perform database design effectively
 Write queries using normalization criteria and optimize queries
 Compare and contrast various indexing strategies in different database systems
 Appraise how advanced databases differ from traditional databases.

iii
DEPARTMENT OF INFORMATION TECHNOLOGY
GATE QUESTIONS
CS6660 – COMPILER DESIGN
INDEX
-
Academic Year : 2019 – 2020 EVEN
Question Paper Year : 2000 to 2019
Name of the Subject In – Charge : Mrs. R. Arthy, AP/IT
Name(s) of the Student Mentor :
-

Number of
S. No. Name of the Topic Page Number
Questions

1 Relational Algebra 15 1 - 15

2 SQL 20 16 - 33

3 ER Diagram 7 34 - 38

4 Normalization 34 39 - 54

5 Transactions 18 55 - 64

6 File Structure 8 65 - 69

Faculty In – Charge GATE Coordinator HoD/IT

iv
DEPARTMENT OF INFORMATION TECHNOLOGY
GATE QUESTIONS
CS8492 – DATABASE MANAGEMENT SYSTEMS
ASSESSMENT REPORT
Signature Signature
Question
Mark of the of the
S. No. Date Hour Name of the Topic Numbers
(10) Student Subject In
Solved
Mentor – Charge

v
Signature Signature
Question
Mark of the of the
S. No. Date Hour Name of the Topic Numbers
(10) Student Subject In
Solved
Mentor – Charge

Signature of GATE Co-ordinator HoD/IT

vi
CERTIFICATE OF COMPLETION

This is to certify that ___________________________________________________ of II year

Information Technology department has completed GATE training on DATABASE

MANAGEMENT SYSTEMS and secured ______________________________ mark out of

_______________ during the academic year 2019 – 2020 EVEN.

Faculty In – Charge GATE Coordinator HoD/IT

vii
CS8492 – Database Management Systems

DEPARTMENT OF INFORMATION TECHNOLOGY


GATE QUESTIONS
CS8492 – DATABASE MANAGEMENT SYSTEMS
TOPIC: Relational Algebra

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

1.1 Consider the following relation P(X, Y, Z), Q(X, Y, T) and R(Y, V):

How many tuples will be returned by the following relational algebra query?
πx(σ(P.Y = R.Y ∧ R.V = V(P X R))) - πx(σ(Q.Y = R.Y ∧ Q.T > 2(Q X R)))
Note: This was Numerical Type question.
GATE | GATE CS 2019 | Question 63

(A) 3
(B) 1
(C) 2
(D) 4

Page | 1 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

1.2 Consider the relations r(A, B) and s(B, C), where s.B is a primary key and r.B is a foreign key
referencing s.B. Consider the query
Q: r⋈(σB<5(s))
Let LOJ denote the natural left outer-join operation. Assume that r and s contain no null values.
Which one of the following is NOT equivalent to Q?
GATE | GATE CS 2018 | Question 59

(A) σB<5(r ⋈ s)
(B) σB<5(r LOJ s)
(C) r LOJ (σB<5(s))
(D) σB<5(r)LOJ s

Page | 2 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: Relational Algebra

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

1.3 The following functional dependencies hold true for the relational schema R{V, W, X, Y, Z}:
V -> W
VW -> X
Y -> VX
Y -> Z
Which of the following is irreducible equivalent for this set of functional dependencies?

GATE | GATE-CS-2017 (Set 1) | Question 15

(A) A
(B) B
(C) C
(D) D

Page | 3 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

1.4 Consider a database that has the relation schemas EMP (EmpId, EmpName, DepId), and
DEPT(DeptName, DeptId). Note that the DepId can be permitted to be NULL in the relation EMP.
Consider the following queries on the database expressed in tuple relational calculus.
I. {t | ∃ u ∈ EMP (t[EMPName] = u[EmpName] ∧ ∀ v ∈ DEPT (t[DeptId] ≠ DeptId]))}
II. {t | ∃ u ∈ EMP (t[EMPName] = u[EmpName] ∧ ∃ v ∈ DEPT (t[DeptId] ≠ DeptId]))}

III. {t | ∃ u ∈ EMP (t[EMPName] = u[EmpName] ∧ ∃ v ∈ DEPT (t[DeptId] = DeptId]))}


GATE | GATE-CS-2017 (Set 1) | Question 36

(A) I and II only


(B) I and III only
(C) II and III only
(D) I, II, and III

Page | 4 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: Relational Algebra

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

1.5 Consider a database that has the relation schema CR(StudentName, CourseName). An instance
of the schema CR is as given below.

The following query is made on the database.

T1 ← πCourseName(σStudentName=’SA’(CR))
T2 ← CR ÷ T1
The number of rows in T2 is ________.
Note: This questions appeared as Numerical Answer Type.
GATE | GATE-CS-2017 (Set 1) | Question 59

(A) 2
(B) 3
(C) 4
(D) 5

Page | 5 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

Page | 6 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

1.6 Suppose (A, B) and (C,D) are two relation schemas. Let r1 and r2 be the corresponding relation
instances. B is a foreign key that refers to C in r2. If data in r1 and r2 satisfy referential integrity
constraints, which of the following is ALWAYS TRUE?

GATE | GATE CS 2012 | Question 41

(A) A
(B) B
(C) C
(D) D

Page | 7 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: Relational Algebra

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

1.7 Consider the following relations A, B, C. How many tuples does the result of the following
relational algebra expression contain? Assume that the schema of A U B is the same as that of A.

Table A
Id Name Age
----------------
12 Arun 60
15 Shreya 24
99 Rohit 11

Table B
Id Name Age
----------------
15 Shreya 24
25 Hari 40
98 Rohit 20
99 Rohit 11

Table C
Id Phone Area
-----------------
10 2200 02
99 2100 01
GATE | GATE CS 2012 | Question 50

(A) 7
(B) 4
(C) 5
(D) 9

Page | 8 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

1.8 Consider a relational table r with sufficient number of records, having attributes A1, A2,…, An
and let 1 <= p <= n. Two queries Q1 and Q2 are given below.

The database can be configured to do ordered indexing on Ap or hashing on Ap. Which of the
following statements is TRUE?
GATE | GATE CS 2011 | Question 39

(A) Ordered indexing will always outperform hashing for both queries
(B) Hashing will always outperform ordered indexing for both queries
(C) Hashing will outperform ordered indexing on Q1, but not on Q2
(D) Hashing will outperform ordered indexing on Q2, but not on Q1.

1.9 Which of the following tuple relational calculus expression(s) is/are equivalent to

GATE | GATE CS 2008 | Question 14

(A) I only
(B) II only
(C) III only
(D) III and IV only

1.10 1) Let R and S be two relations with the following schema


R (P,Q,R1,R2,R3)
S (P,Q,S1,S2)
Where {P, Q} is the key for both schemas. Which of the following queries are equivalent?

GATE | GATE CS 2008 | Question 68

(A) Only I and II


(B) Only I and III
(C) Only I, II and III
(D) Only I, III and IV

Page | 9 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: Relational Algebra

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

1.11 Consider the following relational schema.


Students(rollno: integer, sname: string)
Courses(courseno: integer, cname: string)
Registration(rollno: integer, courseno: integer, percent: real)
Which of the following queries are equivalent to this query in English?
"Find the distinct names of all students who score
more than 90% in the course numbered 107"

GATE | GATE CS 2013 | Question 65

(A) I, II, III and IV


(B) I, II and III only
(C) I, II and IV only
(D) II, III and IV only

Page | 10 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

1.12 Consider the relation employee(name, sex, supervisorName) with name as the key.
supervisorName gives the name of the supervisor of the employee under consideration.
What does the following Tuple Relational Calculus query produce?

GATE | GATE-CS-2007 | Question 60

(A) Names of employees with a male supervisor.


(B) Names of employees with no immediate male subordinates.
(C) Names of employees with no immediate female subordinates.
(D) Names of employees with a female supervisor.

1.13 Consider a join (relation algebra) between relations r(R)and s(S) using the nested loop method.
There are 3 buffers each of size equal to disk block size, out of which one buffer is reserved for
intermediate results. Assuming size(r(R)) < size(s(S)), the join will have fewer number of disk block
accesses if
GATE | GATE-CS-2014-(Set-2) | Question 65

(A) relation r(R) is in the outer loop.


(B) relation s(S) is in the outer loop.
(C) join selection factor between r(R) and s(S) is more than 0.5.
(D) join selection factor between r(R) and s(S) is less than 0.5.

Page | 11 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

1.14
GATE | GATE-CS-2014-(Set-3) | Question 65

(A) A
(B) B
(C) C
(D) D

1.15 Consider the relational schema given below, where eId of the relation dependent is a foreign key
referring to empId of the relation employee. Assume that every employee has at least one associated
dependent in the dependent relation.
employee (empId, empName, empAge)
dependent(depId, eId, depName, depAge)
Consider the following relational algebra query:

The above query evaluates to the set of empIds of employees whose age is greater than that of
GATE | GATE-CS-2014-(Set-3) | Question 65

(A) some dependent.


(B) all dependents.
(C) some of his/her dependents
(D) all of his/her dependents.

Page | 12 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: SQL

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

2.1 A relational database contains two tables Student and Performance as shown below:

The primary key of the Student table is Roll_no. For the Performance table, the columns Roll_no. and
Subject_code together from the primary key. Consider the SQL query given below:
SELECT S.Student_name, sum(P.Marks)
FROM Student S, Performance P
WHERE P.Marks > 84
GROUP BY S.Student_name;
The number of rows returned by the above SQL query is _________ .
Note: This was Numerical Type question.
GATE | GATE CS 2019 | Question 61

(A) 5
(B) 4
(C) 3
(D) None of these.

Page | 13 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

2.2 Consider the following two tables and four queries in SQL.
Book (isbn, bname), Stock (isbn, copies)
Query 1:
SELECT B.isbn, S.copies FROM Book B INNER JOIN Stock S ON B.isbn = S.isbn;

Query 2:
SELECT B.isbn, S.copies FROM B B LEFT OUTER JOIN Stock S ON B.isbn = S.isbn;

Query 3:
SELECT B.isbn, S.copies FROM Book B RIGHT OUTER JOIN Stock S ON B.isbn = S.isbn;

Query 4:
SELECT B.isbn, S.copies FROM B B FULL OUTER JOIN Stock S ON B.isbn = S.isbn;
Which one of the queries above is certain to have an output that is a superset of the outputs of the
other three queries?
GATE | GATE CS 2018 | Question 29

(A) Query 1
(B) Query 2
(C) Query 3
(D) Query 4

Page | 14 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

2.3 Consider a database that has the relation schema EMP (EmpId, EmpName, and DeptName). An
instance of the schema EMP and a SQL query on it are given below.

The output of executing the SQL query is _______.


Note: This questions appeared as Numerical Answer Type.

(A) 1.2
(B) 2.3
(C) 2.6
(D) 3.1

Page | 15 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

2.4 Consider the following database table named top_scorer.

Consider the following SQL query:


SELECT ta.player FROM top_scorer AS ta WHERE ta.goals > ALL ( SELECT tb.goals
FROM top_scorer AS tb WHERE tb.country = 'Spain' )
AND ta.goals > ANY (SELECT tc.goals FROM top_scorer AS tc
WHERE tc.country = 'Germany')
The number of tuples returned by the above SQL query is ____.
Note: This questions appeared as Numerical Answer Type.
GATE | GATE-CS-2017 (Set 2) | Question 61

(A) 6
(B) 7
(C) 8
(D) 9

Page | 16 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: SQL

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

2.5 Which of the following is NOT a superkey in a relational schema with attributes V, W, X, Y, Z
and primary key V Y ?
GATE | GATE-CS-2016 (Set 1) | Question 31

(A) V X Y Z
(B) V W X Z
(C) V W X Y
(D) V W X Y Z

2.6 Consider the following database table named water_schemes :

The number of tuples returned by the following SQL query is


with total(name, capacity) as select district_name, sum(capacity) from water_schemes group by
district_name
with total_avg(capacity) as select avg(capacity) from total select name from total, total_avg
where total.capacity >= total_avg.capacity
GATE | GATE-CS-2016 (Set 2) | Question 62

(A) 1
(B) 2
(C) 3
(D) 4

Page | 17 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: SQL

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

2.7 Select operation in SQL is equivalent to


GATE | GATE-CS-2015 (Set 1) | Question 65

(A) the selection operation in relational algebra


(B) the selection operation in relational algebra, except that select in SQL retains duplicates
(C) the projection operation in relational algebra
(D) the projection operation in relational algebra, except that select in SQL retains duplicates

2.8 Consider the following relations:

SELECT S. Student_Name, sum(P.Marks) FROM Student S, Performance P WHERE S.Roll_No =


P.Roll_No GROUP BY S.Student_Name
The number of rows that will be returned by the SQL query is _________
GATE | GATE-CS-2015 (Set 1) | Question 65

(A) 0
(B) 1
(C) 2
(D) 3

Page | 18 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

2.9 Consider the following relation


Cinema (theater, address, capacity)
Which of the following options will be needed at the end of the SQL query
SELECT P1. Address FROM Cinema P1
Such that it always finds the addresses of theaters with maximum capacity?
GATE | GATE-CS-2015 (Set 3) | Question 65

(A) WHERE P1. Capacity> = All (select P2. Capacity from Cinema P2)
(B) WHERE P1. Capacity> = Any (select P2. Capacity from Cinema P2)
(C) WHERE P1. Capacity > All (select max(P2. Capacity) from Cinema P2)
(D) WHERE P1. Capacity > Any (select max (P2. Capacity) from Cinema P2)

Page | 19 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: SQL

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

2.10 Which of the following statements are TRUE about an SQL query?
P : An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause
Q : An SQL query can contain a HAVING clause only if it has a GROUP BY clause
R : All attributes used in the GROUP BY clause must appear in the SELECT clause
S : Not all attributes used in the GROUP BY clause need to appear in the SELECT clause
GATE | GATE CS 2012 | Question 15

(A) P and R
(B) P and S
(C) Q and R
(D) Q and S

Page | 20 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

4.11 Table A
Id Name Age
----------------
12 Arun 60
15 Shreya 24
99 Rohit 11

Table B
Id Name Age
----------------
15 Shreya 24
25 Hari 40
98 Rohit 20
99 Rohit 11

Table C
Id Phone Area
-----------------
10 2200 02
99 2100 01
Consider the above tables A, B and C. How many tuples does the result of the following SQL query
contains?
SELECT A.id FROM A WHERE A.age > ALL (SELECT B.age FROM B WHERE B. name =
"arun")
GATE | GATE CS 2012 | Question 51

(A) 4
(B) 3
(C) 0
(D) 1

2.12 Consider a database table T containing two columns X and Y each of type integer. After the
creation of the table, one record (X=1, Y=1) is inserted in the table.
Let MX and My denote the respective maximum values of X and Y among all records in the table at
any point in time. Using MX and MY, new records are inserted in the table 128 times with X and Y
values being MX+1, 2*MY+1 respectively. It may be noted that each time after the insertion, values
of MX and MY change. What will be the output of the following SQL query after the steps mentioned
above are carried out?
SELECT Y FROM T WHERE X=7;
GATE | GATE CS 2011 | Question 32

(A) 127
(B) 255
(C) 129
(D) 257

Page | 21 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: SQL

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

2.13 Database table by name Loan_Records is given below.


Borrower Bank_Manager Loan_Amount
Ramesh Sunderajan 10000.00
Suresh Ramgopal 5000.00
Mahesh Sunderajan 7000.00
What is the output of the following SQL query?
SELECT Count(*) FROM ( ( SELECT Borrower, Bank_Manager FROM Loan_Records) AS S
NATURAL JOIN ( SELECT Bank_Manager, Loan_Amount FROM Loan_Records) AS T );
GATE | GATE CS 2011 | Question 46

(A) 3
(B) 9
(C) 5
(D) 6

2.14 A relational schema for a train reservation database is given below.


Passenger (pid, pname, age)
Reservation (pid, class, tid)
Table: Passenger
pid pname age
-----------------
0 Sachin 65
1 Rahul 66
2 Sourav 67
3 Anil 69

Table : Reservation
pid class tid
---------------
0 AC 8200
1 AC 8201
2 SC 8201
5 AC 8203
1 SC 8204
3 AC 8202
What pids are returned by the following SQL query for the above instance of the tables?
SLECT pid FROM Reservation WHERE class ‘AC’ AND EXISTS (SELECT * FROM Passenger
WHERE age > 65 AND Passenger. pid = Reservation.pid)
GATE | GATE CS 2010 | Question 19

(A) 1, 0
(B) 1, 2
(C) 1, 3
(D) 1, 5

Page | 22 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

2.15 Consider the following relational schema:


Suppliers(sid:integer, sname:string, city:string, street:string)
Parts(pid:integer, pname:string, color:string)
Catalog(sid:integer, pid:integer, cost:real)
Consider the following relational query on the above database:
SELECT S.sname FROM Suppliers S WHERE S.sid NOT IN (SELECT C.sid FROM Catalog C
WHERE C.pid NOT IN (SELECT P.pid FROM Parts P WHERE P.color<> 'blue'))
Assume that relations corresponding to the above schema are not empty. Which one of the following
is the correct interpretation of the above query?
GATE | GATE-CS-2009 | Question 55

(A) Find the names of all suppliers who have supplied a non-blue part.
(B) Find the names of all suppliers who have not supplied a non-blue part.
(C) Find the names of all suppliers who have supplied only blue parts.
(D) Find the names of all suppliers who have not supplied only blue parts.
(E) None

2.16 Consider the table employee(empId, name, department, salary) and the two queries Q1 ,Q2
below. Assuming that department 5 has more than one employee, and we want to find the employees
who get higher salary than anyone in the department 5, which one of the statements is TRUE for any
arbitrary employee table?
Q1 : Select e.empId From employee e Where not exists (Select * From employee s where
s.department = “5” and s.salary >=e.salary)
Q2 : Select e.empId From employee e Where e.salary > Any (Select distinct salary From employee s
Where s.department = “5”)
GATE | GATE-CS-2007 | Question 61

(A) Q1 is the correct query


(B) Q2 is the correct query
(C) Both Q1 and Q2 produce the same answer.
(D) Neither Q1 nor Q2 is the correct query

Page | 23 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: SQL

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

2.17 Given the following statements:


S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL.
S2: Given the table R(a,b,c) where a and b together form the primary key, the following is a valid
table definition.
CREATE TABLE S (a INTEGER, d INTEGER, e INTEGER, PRIMARY KEY (d),
FOREIGN KEY (a) references R)
Which one of the following statements is CORRECT?
GATE | GATE-CS-2014-(Set-1) | Question 65

(A) S1 is TRUE and S2 is FALSE.


(B) Both S1 and S2 are TRUE.
(C) S1 is FALSE and S2 is TRUE.
(D) Both S1 and S2 are FALSE.

Page | 24 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

2.18 SQL allows tuples in relations, and correspondingly defines the multiplicity of tuples in the result
of joins. Which one of the following queries always gives the same answer as the nested query shown
below:
select * from R where a in (select S.a from S)
GATE | GATE-CS-2014-(Set-2) | Question 65

(A) select R.* from R, S where R.a=S.a


(B) select distinct R.* from R,S where R.a=S.a
(C) select R.* from R,(select distinct a from S) as S1 where R.a=S1.a
(D) select R.* from R,S where R.a=S.a and is unique R

Page | 25 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: SQL

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

2.19 Consider the following relational schema:


employee(empId, empName, empDept)
customer(custId, custName, salesRepId, rating)
salesRepId is a foreign key referring to empId of the employee relation. Assume that each employee
makes a sale to at least one customer. What does the following query return?
SELECT empName FROM employee E WHERE NOT EXISTS ( SELECT custId FROM customer C
WHERE C.salesRepId = E.empId AND C.rating <> `GOOD`);
GATE | GATE-CS-2014-(Set-3) | Question 65

(A) Names of all the employees with at least one of their customers having a ‘GOOD’ rating.
(B) Names of all the employees with at most one of their customers having a ‘GOOD’ rating.
(C) Names of all the employees with none of their customers having a ‘GOOD’ rating.
(D) Names of all the employees with all their customers having a ‘GOOD’ rating.

2.20 Consider the relation account (customer, balance) where customer is a primary key and there are
no null values. We would like to rank customers according to decreasing balance. The customer with
the largest balance gets rank 1. ties are not broke but ranks are skipped: if exactly two customers have
the largest balance they each get rank 1 and rank 2 is not assigned
Query1:
select A.customer, count(B.customer) from account A, account B where A.balance <=B.balance
group by A.customer

Query2:
select A.customer, 1+count(B.customer) from account A, account B where A.balance < B.balance
group by A.customer
Consider these statements about Query1 and Query2.
1. Query1 will produce the same row set as Query2 for some but not all databases.
2. Both Query1 and Query2 are correct implementation of the specification
3. Query1 is a correct implementation of the specification but Query2 is not
4. Neither Query1 nor Query2 is a correct implementation of the specification
5. Assigning rank with a pure relational query takes less time than scanning in decreasing balance
order assigning ranks using ODBC.
Which two of the above statements are correct?
GATE | GATE-CS-2006 | Question 67

(A) 2 and 5
(B) 1 and 3
(C) 1 and 4
(D) 3 and 5

Page | 26 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

2.21 Consider the relation “enrolled(student, course)” in which (student, course) is the primary key,
and the relation “paid(student, amount)” where student is the primary key. Assume no null values and
no foreign keys or integrity constraints. Given the following four queries:
Query1: select student from enrolled where student in (select student from paid)
Query2: select student from paid where student in (select student from enrolled)
Query3: select E.student from enrolled E, paid P where E.student = P.student
Query4: select student from paid where exists (select * from enrolled where enrolled.student
= paid.student)
Which one of the following statements is correct?
GATE | GATE-CS-2006 | Question 68

(A) All queries return identical row sets for any database
(B) Query2 and Query4 return identical row sets for all databases but there exist databases for which
Query1 and Query2 return different row sets.
(C) There exist databases for which Query3 returns strictly fewer rows than Query2
(D) There exist databases for which Query4 will encounter an integrity violation at runtime.

2.22 The following table has two attributes A and C where A is the primary key and C is the foreign
key referencing A with on-delete cascade.
A C
-----
2 4
3 4
4 3
5 2
7 2
9 5
6 4
The set of all tuples that must be additionally deleted to preserve referential integrity when the tuple
(2,4) is deleted is:
GATE | GATE-CS-2005 | Question 76

(A) (3,4) and (6,4)


(B) (5,2) and (7,2)
(C) (5,2), (7,2) and (9,5)
(D) (3,4), (4,3) and (6,4)

Page | 27 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: SQL

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

2.23 The relation book (title, price) contains the titles and prices of different books. Assuming that no
two books have the same price, what does the following SQL query list?
select title from book as B where (select count(*) from book as T where T.price > B.price) < 5
GATE | GATE-CS-2005 | Question 77

(A) Titles of the four most expensive books


(B) Title of the fifth most inexpensive book
(C) Title of the fifth most expensive bookTitles of the five most expensive books
(D) Titles of the five most expensive books

2.24 Consider the following relation schema pertaining to a students database:


Student (rollno, name, address)
Enroll (rollno, courseno, coursename)
where the primary keys are shown underlined. The number of tuples in the Student and Enroll tables
are 120 and 8 respectively. What are the maximum and minimum number of tuples that can be present
in (Student * Enroll), where ‘*’ denotes natural join?
GATE | GATE-CS-2004 | Question 90

(A) 8, 8
(B) 120, 8
(C) 960, 8
(D) 960, 120

2.25 The employee information in a company is stored in the relation


Employee (name, sex, salary, deptName)
Consider the following SQL query
select deptName
from Employee
where sex = 'M'
group by deptName
having avg (salary) > (select avg (salary) from Employee)
It returns the names of the department in which
GATE | GATE-CS-2004 | Question 53

(A) the average salary is more than the average salary in the company
(B) the average salary of male employees is more than the average salary of all male employees in the
company
(C) the average salary of male employees is more than the average salary of employees in the same
department
(D) the average salary of male employees is more than the average salary in the company

Page | 28 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

2.26 Consider the set of relations shown below and the SQL query that follows.
Students: (Roll_number, Name, Date_of_birth)
Courses: (Course number, Course_name, Instructor)
Grades: (Roll_number, Course_number, Grade)
select distinct Name from Students, Courses, Grades where Students. Roll_number =
Grades.Roll_number and Courses.Instructor = Korth and Courses.Course_number =
Grades.Course_number and Grades.grade = A
GATE | GATE-CS-2003 | Question 86

Which of the following sets is computed by the above query?


(A) Names of students who have got an A grade in all courses taught by Korth
(B) Names of students who have got an A grade in all courses
(C) Names of students who have got an A grade in at least one of the courses taught by Korth
(D) None of the above

2.27 Given relations r(w, x) and s(y, z), the result of


SELECT DISTINCT w, x FROM r, s
is guaranteed to be same as r, provided
GATE | GATE-CS-2000 | Question 49

(A) r has no duplicates and s is non-empty


(B) r and s have no duplicates
(C) s has no duplicates and r is non-empty
(D) r and s have the same number of tuples

Page | 29 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: SQL

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

2.28 A company maintains records of sales made by its salespersons and pays them commission based
on each individual’s total sales made in a year. This data is maintained in a table with following
schema:
salesinfo = (salespersonid, totalsales, commission)
In a certain year, due to better business results, the company decides to further reward its salespersons
by enhancing the commission paid to them as per the following formula:
If commission < = 50000, enhance it by 2%
If 50000 < commission < = 100000, enhance it by 4%
If commission > 100000, enhance it by 6%
The IT staff has written three different SQL scripts to calculate enhancement for each slab, each of
these scripts is to run as a separate transaction as follows:
Update salesinfo Set commission = commission * 1.02 Where commission < =
T1 50000;

Update salesinfo Set commission = commission * 1.04 Where commission >


T2 50000 and commission is < = 100000;

Update salesinfo Set commission = commission * 1.06 Where commission >


T3 100000;
Which of the following options of running these transactions will update the commission of all
salespersons correctly
GATE | Gate IT 2005 | Question 67

(A) Execute T1 followed by T2 followed by T3


(B) Execute T2, followed by T3; T1 running concurrently throughout
(C) Execute T3 followed by T2; T1 running concurrently throughout
(D) Execute T3 followed by T2 followed by T1

Page | 30 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

2.29 A table ‘student’ with schema (roll, name, hostel, marks), and another table ‘hobby’ with schema
(roll, hobbyname) contains records as shown below:
ROLL NAME HOSTEL MARKS

1798 Manoj Rathod 7 95

2154 Soumic Banerjee 5 68

2369 Gumma Reddy 7 86

2581 Pradeep Pendse 6 92

2643 Suhas Kulkarni 5 78

2711 Nitin Kadam 8 72

2872 Kiran Vora 5 92

2926 Manoj Kunkalikar 5 94

2959 Hemant Karkhanis 7 88

3125 Rajesh Doshi 5 82

Table: Student

ROLL HOBBYNAME

1798 chess

1798 music

2154 music

2369 swimming

2581 cricket

2643 chess

2643 hockey

2711 volleyball

2872 football

2926 cricket

2959 photography

3125 music

3125 chess

Page | 31 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

Table: hobby
The following SQL query is executed on the above tables:
select hostel from student natural join hobby where marks > = 75 and roll between 2000 and 3000;
Relations S and H with the same schema as those of these two tables respectively contain the same
information as tuples. A new relation S’ is obtained by the following relational algebra operation:
S’ = ∏hostel ((σs.roll = H.roll (σmarks > 75 and roll > 2000 and roll < 3000 (S)) X (H))
The difference between the number of rows output by the SQL statement and the number of tuples in
S’ is
GATE | Gate IT 2005 | Question 68

(A) 6
(B) 4
(C) 2
(D) 0

Page | 32 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: SQL

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

2.30 In an inventory management system implemented at a trading corporation, there are several
tables designed to hold all the information. Amongst these, the following two tables hold information
on which items are supplied by which suppliers, and which warehouse keeps which items along with
the stock-level of these items.
Supply = (supplierid, itemcode)
Inventory = (itemcode, warehouse, stocklevel)
For a specific information required by the management, following SQL query has been written
Select distinct STMP.supplierid From Supply as STMP Where not unique (Select ITMP.supplierid
From Inventory, Supply as ITMP Where STMP.supplierid = ITMP.supplierid
And ITMP.itemcode = Inventory.itemcode And Inventory.warehouse = 'Nagpur');
For the warehouse at Nagpur, this query will find all suppliers who
GATE | Gate IT 2005 | Question 69

(A) do not supply any item


(B) supply exactly one item
(C) supply one or more items
(D) supply two or more items

Page | 33 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: ER Diagram

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

3.1. In an Entity-Relationship (ER) model, suppose R is a many-to-one relationship from entity set E1
to entity set E2. Assume that E1 and E2 participate totally in R and that the cardinality of E1 is greater
that the cardinality of E2.
Which one of the following is true about R?
GATE | GATE CS 2018 | Question 24

(A) Every entity in E1 is associated with exactly one entity in E2.


(B) Some entity in E1 is associated with more than one entity in E2.
(C) Every entity in E2 is associated with exactly one entity in E1.
(D) Every entity in E2 is associated with at most one entity in E1.

3.2. An ER model of a database consists of entity types A and B. These are connected by a
relationship R which does not have its own attribute. Under which of the following conditions, can the
relational table for R be merged with that of A?
GATE | GATE-CS-2017 (Set 2) | Question 16

(A) Relation R is one-to-many and the participation of A in R is total.


(B) Relation R is one-to-many and the participation of A in R is partial.
(C) Relation R is many-to-one and the participation of A in R is total.
(D) Relation R is many-to-one and the participation of A in R is partial.

(A) A
(B) B
(C) C
(D) D

Page | 34 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

3.3. Consider an Entity-Relationship (ER) model in which entity sets E1 and E2 are connected by an
m : n relationship R12, E1 and E3 are connected by a 1 : n (1 on the side of E1 and n on the side of E3)
relationship R13.
E1 has two single-valued attributes a11 and a12 of which a11 is the key attribute. E2 has two single-
valued attributes a21 and a22 is the key attribute. E3 has two single-valued attributes a31 and a32 of
which a31 is the key attribute. The relationships do not have any attributes.
If a relational model is derived from the above ER model, then the minimum number of relations that
would be generated if all the relations are in 3NF is ___________.
GATE | GATE-CS-2015 (Set 1) | Question 65

(A) 2
(B) 3
(C) 4
(D) 5

Page | 35 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: ER Diagram

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

3.4. Consider the following ER diagram.

The minimum number of tables needed to represent M, N, P, R1, R2 is


GATE | GATE CS 2008 | Question 85

(A) 2
(B) 3
(C) 4
(D) 5

3.5. Consider the data given in above question. Which of the following is a correct attribute set for
one of the tables for the correct answer to the above question?

GATE | GATE CS 2008 | Question 83

(A) {M1, M2, M3, P1}


(B) {M1, P1, N1, N2}
(C) {M1, P1, N1}
(D) {M1, P1}

Page | 36 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

3.6. Given the basic ER and relational models, which of the following is INCORRECT?
GATE | GATE CS 2012 | Question 14

(A) An attribute of an entity can have more than one value


(B) An attribute of an entity can be composite
(C) In a row of a relational table, an attribute can have more than one value
(D) In a row of a relational table, an attribute can have exactly one value or a NULL value

3.7. Let E1 and E2 be two entities in an E/R diagram with simple single-valued attributes. R1 and R2
are two relationships between E1 and E2, where R1 is one-to-many and R2 is many-to-many. R1 and
R2 do not have any attributes of their own. What is the minimum number of tables required to
represent this situation in the relational model?
GATE | GATE-CS-2005 | Question 90

(A) 2
(B) 3
(C) 4
(D) 5

Page | 37 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

Page | 38 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: Normalization

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

4.1. Let the set of functional dependencies F = {QR → S, R → P, S → Q} hold on a relation schema
X = (PQRS). X is not in BCNF. Suppose X is decomposed into two schemas and Z where Y = (PR)
and Z = (QRS). Consider the two statements given below:
 I. Both Y and Z are in BCNF
 II. Decomposition of X into Y and Z is dependency preserving and a lossless.
Which of the above statements is/are correct?
GATE | GATE CS 2019 | Question 41

(A) I only
(B) Neither I nor II
(C) Both I and II
(D) II only

Page | 39 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

4.2 Consider the following four relational schemas. For each schema, all non-trivial functional
dependencies are listed, The underlined attributes are the respective primary keys.
 Schema I: Registration(rollno, courses)
Field ‘courses’ is a set-valued attribute containing the set of courses a student has registered for.
Non-trivial functional dependency
rollno → courses
 Schema II: Registration (rollno, coursid, email)
Non-trivial functional dependencies:
rollno, courseid → email
email → rollno
 Schema III: Registration (rollno, courseid, marks, grade)
Non-trivial functional dependencies:
rollno, courseid, → marks, grade
marks → grade
 Schema IV: Registration (rollno, courseid, credit)
Non-trivial functional dependencies:
rollno, courseid → credit
courseid → credit
Which one of the relational schemas above is in 3NF but not in BCNF?
GATE | GATE CS 2018 | Question 64

(A) Schema I
(B) Schema II
(C) Schema III
(D) Schema IV

Page | 40 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

4.3 A database of research articles in a journal uses the following schema.


(VOLUME, NUMBER, STARTPGE, ENDPAGE, TITLE, YEAR, PRICE)
The primary key is (VOLUME, NUMBER, STARTPAGE, ENDPAGE) and the following functional
dependencies exist in the schema.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> TITLE
(VOLUME, NUMBER) -> YEAR
(VOLUME, NUMBER, STARTPAGE, ENDPAGE) -> PRICE
The database is redesigned to use the following schemas.
(VOLUME, NUMBER, STARTPAGE, ENDPAGE, TITLE, PRICE)
(VOLUME, NUMBER, YEAR)
Which is the weakest normal form that the new database satisfies, but the old one does not?
GATE | GATE-CS-2016 (Set 1) | Question 33

(A) 1NF
(B) 2NF
(C) 3NF
(D) BCNF

4.4 Consider the relation X(P, Q, R, S, T, U) with the following set of functional dependencies
F={
{P, R} → {S,T},
{P, S, U} → {Q, R}
}
Which of the following is the trivial functional dependency in F+ is closure of F?
GATE | GATE-CS-2015 (Set 3) | Question 65

(A) {P,R}→{S,T}
(B) {P,R}→{R,T}
(C) {P,S}→{S}
(D) {P,S,U}→{Q}

Page | 41 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: Normalization

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

4.5. Relation R has eight attributes ABCDEFGH. Fields of R contain only atomic values. F = {CH -->
G, A -> BC, B -> CFH, E -> A, F -> EG} is a set of functional dependencies (FDs) so that F+ is
exactly the set of FDs that hold for R.
How many candidate keys does the relation R have?
GATE | GATE CS 2013 | Question 54

(A) 3
(B) 4
(C) 5
(D) 6

4.6 Consider the FDs given in above question. The relation R is


GATE | GATE CS 2013 | Question 55

(A) in 1NF, but not in 2NF.


(B) in 2NF, but not in 3NF.
(C) in 3NF, but not in BCNF.
(D) in BCNF

4.7 Which of the following is TRUE?


GATE | GATE CS 2012 | Question 2

(A) Every relation in 3NF is also in BCNF


(B) A relation R is in 3NF if every non-prime attribute of R is fully functionally dependent on every
key of R
(C) Every relation in BCNF is also in 3NF
(D) No relation can be in both BCNF and 3NF

Page | 42 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

4.8 Consider a relational table with a single record for each registered student with the following
attributes.
1. Registration_Num: Unique registration number
of each registered student
2. UID: Unique identity number, unique at the
national level for each citizen
3. BankAccount_Num: Unique account number at
the bank. A student can have multiple accounts
or join accounts. This attribute stores the
primary account number.
4. Name: Name of the student
5. Hostel_Room: Room number of the hostel
Which one of the following option is INCORRECT?
GATE | GATE CS 2011 | Question 65

(A) BankAccount_Num is candidate key


(B) Registration_Num can be a primary key
(C) UID is candidate key if all students are from the same country
(D) If S is a superkey such that S∩UID is NULL then S∪UID is also a superkey

Page | 43 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: Normalization

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

4.9 Consider the following relational schema:


Suppliers(sid:integer, sname:string, city:string, street:string)
Parts(pid:integer, pname:string, color:string)
Catalog(sid:integer, pid:integer, cost:real)
Assume that, in the suppliers relation above, each supplier and each street within a city has a unique
name, and (sname, city) forms a candidate key. No other functional dependencies are implied other
than those implied by primary and candidate keys. Which one of the following is TRUE about the
above schema?
GATE | GATE-CS-2009 | Question 56

(A) The schema is in BCNF


(B) The schema is in 3NF but not in BCNF
(C) The schema is in 2NF but not in 3NF
(D) The schema is not in 2NF

4.10 Consider the following relational schemes for a library database:


Book (Title, Author, Catalog_no, Publisher, Year, Price)
Collection (Title, Author, Catalog_no)
with in the following functional dependencies:
I. Title Author --> Catalog_no
II. Catalog_no --> Title, Author, Publisher, Year
III. Publisher Title Year --> Price
Assume {Author, Title} is the key for both schemes. Which of the following statements is true?
GATE | GATE CS 2008 | Question 69

(A) Both Book and Collection are in BCNF


(B) Both Book and Collection are in 3NF only
(C) Book is in 2NF and Collection is in 3NF
(D) Both Book and Collection are in 2NF only

Page | 44 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

4.11 Consider the relation scheme R = {E, F, G, H, I, J, K, L, M, M} and the set of functional
dependencies {{E, F} -> {G}, {F} -> {I, J}, {E, H} -> {K, L}, K -> {M}, L -> {N} on R. What is the
key for R?
GATE | GATE-CS-2014-(Set-1) | Question 31

(A) {E, F}
(B) {E, F, H}
(C) {E, F, H, K, L}
(D) {E}

4.12 Given the following two statements:


S1: Every table with two single-valued attributes is in 1NF, 2NF, 3NF and BCNF.

S2: AB->C, D->E, E->C is a minimal cover for the set of functional dependencies
AB->C, D->E, AB->E, E->C.
Which one of the following is CORRECT?
GATE | GATE-CS-2014-(Set-1) | Question 40

(A) S1 is TRUE and S2 is FALSE.


(B) Both S1 and S2 are TRUE.
(C) S1 is FALSE and S2 is TRUE.
(D) Both S1 and S2 are FALSE.

Page | 45 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: Normalization

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

4.13 The maximum number of superkeys for the relation schema R(E,F,G,H) with E as the key is
GATE | GATE-CS-2014-(Set-2) | Question 31

(A) 5
(B) 6
(C) 7
(D) 8

4.14 Let R1 (A, B, C) and R2 (D, E) be two relation schema, where the primary keys are shown
underlined, and let C be a foreign key in R1 referring to R2. Suppose there is no violation of the
above referential integrity constraint in the corresponding relation instances r1 and r2. Which one of
the following relational algebra expressions would necessarily produce an empty relation ?

GATE | GATE-CS-2004 | Question 13

(A) 1
(B) 2
(C) 3
(D) 4

4.15 The relation scheme Student Performance (name, courseNo, rollNo, grade) has the following
functional dependencies:
name, courseNo → grade
rollNo, courseNo → grade
name → rollNo
rollNo → name
The highest normal form of this relation scheme is
GATE | GATE-CS-2004 | Question 90

(A) 2 NF
(B) 3 NF
(C) BCNF
(D) 4NF

Page | 46 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

4.16 Consider the following functional dependencies in a database:


Data_of_Birth → Age
Age → Eligibility
Name → Roll_number
Roll_number → Name
Course_number → Course_name
Course_number → Instructor
(Roll_number, Course_number) → Grade
The relation (Roll_number, Name, Date_of_birth, Age) is:
GATE | GATE-CS-2003 | Question 85

(A) In second normal form but not in third normal form


(B) In third normal form but not in BCNF
(C) In BCNF
(D) None of the above

4.17 Relation R with an associated set of functional dependencies, F is decomposed into BCNF. The
redundancy (arising out of functional dependencies) in the resulting set relations is.
GATE | GATE-CS-2002 | Question 23

(A) Zero
(B) More than zero but less than that of an equivalent 3NF decomposition
(C) Proportional to the size of F+
(D) Indeterminate

4.18 With regard to the expressive power of the formal relational query languages, which of the
following statements is true?
GATE | GATE-CS-2002 | Question 20

(A) Relational algebra is more powerful than relational calculus


(B) Relational algebra has the same power as relational calculus
(C) Relational algebra has the same power as safe relational calculus
(D) None of the above

4.19 Relation R is decomposed using a set of functional dependencies, F and relation S is decomposed
using another set of functional dependencies G. One decomposition is definitely BCNF, the other is
definitely 3NF, but it is not known which is which. To make a guaranteed identification, which one of
the following tests should be used on the decompositions? (Assume that the closures of F and G are
available).
GATE | GATE-CS-2002 | Question 50

(A) Dependency-preservation
(B) Lossless-join
(C) BCNF definition
(D) 3NF definition

Page | 47 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: Normalization

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

4.20 From the following instance of a relation scheme R (A, B, C), we can conclude that :

A B C

1 1 1

1 1 0

2 3 2

2 3 2
GATE | GATE-CS-2002 | Question 50

(A) A functionally determines B and B functionally determines C


(B) A functionally determines B and B does not functionally determine C
(C) B does not functionally determine C
(D) A does not functionally determine B and B does not functionally determine C

4.21 Consider a schema R(A,B,C,D) and functional dependencies A->B and C->D.
Then the decomposition of R into R1(AB) and R2(CD) is
GATE | GATE-CS-2001 | Question 23

(A) dependency preserving and lossless join


(B) lossless join but not dependency preserving
(C) dependency preserving but not lossless join
(D) not dependency preserving and not lossless join

Page | 48 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: Normalization

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

4.22 Suppose the adjacency relation of vertices in a graph is represented in a table Adj(X,Y). Which
of the following queries cannot be expressed by a relational algebra expression of constant length?
GATE | GATE-CS-2001 | Question 24

(A) List of all vertices adjacent to a given vertex


(B) List all vertices which have self loops
(C) List all vertices which belong to cycles of less than three vertices
(D) List all vertices reachable from a given vertex

4.23 Let r and s be two relations over the relation schemes R and S respectively, and let A be an
attribute in R. then the relational algebra expression is always equal to

GATE | GATE-CS-2001 | Question 25

(A) A
(B) B
(C) C
(D) D

Page | 49 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: Normalization

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

4.24 R(A,B,C,D) is a relation. Which of the following does not have a lossless join, dependency
preserving BCNF decomposition?
GATE | GATE-CS-2001 | Question 48

(A) A->B, B->CD


(B) A->B, B->C, C->D
(C) AB->C, C->AD
(D) A ->BCD

4.25 Which of the following relational calculus expressions is not safe?

GATE | GATE-CS-2001 | Question 49

(A) A
(B) B
(C) C
(D) D

Page | 50 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

4.26 Consider a relation geq which represents “greater than or equal to”, that is, (x,y) ∈ geq only if
y >= x.
create table geq
(
ib integer not null
ub integer not null
primary key 1b
foreign key (ub) references geq on delete cascade
)
Which of the following is possible if a tuple (x,y) is deleted?
GATE | GATE-CS-2001 | Question 50

(A) A tuple (z,w) with z > y is deleted


(B) A tuple (z,w) with z > x is deleted
(C) A tuple (z,w) with w < x is deleted
(D) The deletion of (x,y) is prohibited

4.27 Given the relations


employee (name, salary, deptno) and
department (deptno, deptname, address)
Which of the following queries cannot be expressed using the basic relational algebra operations (U, -,
x, , , p)?
GATE | GATE-CS-2000 | Question 23

(A) Department address of every employee


(B) Employees whose name is the same as their department name
(C) The sum of all employees’ salaries
(D) All employees of a given department

4.28 Given the following relation instance.


x y z
1 4 2
1 5 3
1 6 3
3 2 2
Which of the following functional dependencies are satisfied by the instance? (GATE CS 2000)
GATE | GATE-CS-2000 | Question 47

(A) XY -> Z and Z -> Y


(B) YZ -> X and Y -> Z
(C) YZ -> X and X -> Z
(D) XZ -> Y and Y -> X

Page | 51 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: Normalization

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

4.29 Consider the following entity relationship diagram (ERD), where two entities E1 and E2 have a
relation R of cardinality 1 : m.

The attributes of E1 are A11, A12 and A13 where A11 is the key attribute. The attributes of E2 are
A21, A22 and A23 where A21 is the key attribute and A23 is a multi-valued attribute. Relation R
does not have any attribute. A relational database containing minimum number of tables with each
table satisfying the requirements of the third normal form (3NF) is designed from the above ERD. The
number of tables in the database is
GATE | GATE-IT-2004 | Question 73

(A) 2
(B) 3
(C) 5
(D) 4

4.30 A relational database contains two tables student and department in which student table has
columns roll_no, name and dept_id and department table has columns dept_id and dept_name. The
following insert statements were executed successfully to populate the empty tables:
Insert into department values (1, 'Mathematics')
Insert into department values (2, 'Physics')
Insert into student values (l, 'Navin', 1)
Insert into student values (2, 'Mukesh', 2)
Insert into student values (3, 'Gita', 1)
How many rows and columns will be retrieved by the following SQL statement?
Select * from student, department
GATE | GATE-IT-2004 | Question 74

(A) 0 row and 4 columns


(B) 3 rows and 4 columns
(C) 3 rows and 5 columns
(D) 6 rows and 5 columns

Page | 52 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

4.31 Consider the entities ‘hotel room’, and ‘person’ with a many to many relationship ‘lodging’ as
shown below:

If we wish to store information about


the rent payment to be made by person (s) occupying different hotel rooms, then this information
should appear as an attribute of
GATE | Gate IT 2005 | Question 21

(A) Person
(B) Hotel Room
(C) Lodging
(D) None of these

4.32 A table has fields Fl, F2, F3, F4, F5 with the following functional dependencies
F1 → F3 F2→ F4 (F1 . F2) → F5
In terms of Normalization, this table is in
GATE | Gate IT 2005 | Question 22

(A) 1 NF
(B) 2 NF
(C) 3 NF
(D) none

Page | 53 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: Normalization

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

4.33 Let R (A, B, C, D, E, P, G) be a relational schema in which the following functional depen-
dencies are known to hold: AB → CD, DE → P, C → E, P → C and B → G. The relational schema R
is
GATE | Gate IT 2008 | Question 60

(A) in BCNF
(B) in 3NF, but not in BCNF
(C) in 2NF, but not in 3NF
(D) not in 2NF

4.34 Let R = ( A, B, C, D, E, F ) be a relation scheme with the following dependencies:


C→F, E→A, EC→D, A→B. Which of the following is a key of R?
GATE | GATE CS 1999 | Question 24

(A) CD
(B) EC
(C) AE
(D) AC

Page | 54 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: TRANSACTIOM

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

5.1 In a database system, unique time stamps are assigned to each transaction using Lamport’s logical
clock. Let TS(T1) and TS(T2) be the time stamps of transactions T1 and T2 respectively. Besides, T1
holds a lock on the resource R, and T2 has requested a conflicting lock on the same resource R. The
following algorithm is used to prevent deadlocks in the database assuming that a killed transaction is
restarted with the same timestamp.
if TS(T2) <TS(T1) then
T1 is killed
else T2 waits.
Assume any transactions that is not killed terminates eventually. Which of the following is TRUE
about the database system that uses the above algorithm to prevent deadlocks?
GATE | GATE-CS-2017 (Set 1) | Question 46

(A) The database system is both deadlock-free and starvation- free.


(B) The database system is deadlock- free, but not starvation-free.
(C) The database system is starvation-free but not deadlock- free.
(D) The database system is neither deadlock- free nor starvation-free.

5.2 Consider the following two phase locking protocol. Suppose a transaction T accesses (for read or
write operations), a certain set of objects {O1,…,Ok}. This is done in the following manner:
Step 1. T acquires exclusive locks to O1, . . . , Ok in increasing order of their addresses.
Step 2. The required operations are performed.
Step 3. All locks are released.
This protocol will
GATE | GATE-CS-2016 (Set 1) | Question 61

(A) guarantee serializability and deadlock-freedom


(B) guarantee neither serializability nor deadlock-freedom
(C) guarantee serializability but not deadlock-freedom
(D) guarantee deadlock-freedom but not serializability

Page | 55 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

5.3 Which one of the following is NOT a part of the ACID properties of database transactions?
GATE | GATE-CS-2016 (Set 1) | Question 32

(A) Atomicity
(B) Consistency
(C) Isolation
(D) Deadlock-freedom

5.4 Consider the following database schedule with two transactions, T1 and T2.
S = r2(X); r1(X); r2(Y); w1(X); r1(Y); w2(X); a1; a2;
where ri(Z) denotes a read operation by transaction Ti on a variable Z, wi(Z) denotes a write operation
by Ti on a variable Z and ai denotes an abort by transaction Ti .
Which one of the following statements about the above schedule is TRUE?
GATE | GATE-CS-2016 (Set 2) | Question 61

(A) S is non-recoverable
(B) S is recoverable, but has a cascading abort
(C) S does not have a cascading abort
(D) S is strict

Page | 56 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: TRANSACTIOM

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

5.5 A file is organized so that the ordering of data records is the same as or close to the ordering of
data entries in some index. Then that index is called
GATE | GATE-CS-2015 (Set 1) | Question 65

(A) Dense
(B) Sparse
(C) Clustered
(D) Unclustered

5.6 Consider the following transaction involving two bank accounts x and y.
read(x); x := x – 50; write(x); read(y); y := y + 50; write(y)
The constraint that the sum of the accounts x and y should remain constant is that of
GATE | GATE-CS-2015 (Set 2) | Question 11

(A) Atomicity
(B) Consistency
(C) Isolation
(D) Durability

Page | 57 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

5.7 Consider a simple checkpointing protocol and the following set of operations in the log.
(start, T4); (write, T4, y, 2, 3); (start, T1); (commit, T4); (write, T1, z, 5, 7);
(checkpoint);
(start, T2); (write, T2, x, 1, 9); (commit, T2); (start, T3); (write, T3, z, 7, 2);
If a crash happens now and the system tries to recover using both undo and redo operations, what are
the contents of the undo list and the redo list
GATE | GATE-CS-2015 (Set 2) | Question 56

(A) Undo: T3, T1; Redo: T2


(B) Undo: T3, T1; Redo: T2, T4
(C) Undo: none; Redo: T2, T4, T3; T1
(D) Undo: T3, T1, T4; Redo: T2

5.8 Consider the following partial Schedule S involving two transactions T1 and T2. Only the read
and the write operations have been shown. The read operation on data item P is denoted by read(P)
and the write operation on data item P is denoted by write(P).

Suppose that the transaction T1 fails immediately after time instance 9. Which one of the following
statements is correct?
GATE | GATE-CS-2015 (Set 3) | Question 40

(A) T2 must be aborted and then both T1 and T2 must be re-started to ensure transaction
atomicity
(B) Schedule S is non-recoverable and cannot ensure transaction atomicity
(C) Only T2 must be aborted and then re-started to ensure transaction atomicity
(D) Schedule S is recoverable and can ensure atomicity and nothing else needs to be done

Page | 58 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: TRANSACTIOM

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

5.9 Consider the following transactions with data items P and Q initialized to zero:
T1: read (P) ;
read (Q) ;
if P = 0 then Q : = Q + 1 ;
write (Q) ;
T2: read (Q) ;
read (P) ;
if Q = 0 then P : = P + 1 ;
write (P) ;
Any non-serial interleaving of T1 and T2 for concurrent execution leads to
GATE | GATE CS 2012 | Question 25

(A) A serializable schedule


(B) A schedule that is not conflict serializable
(C) A conflict serializable schedule
(D) A schedule for which a precedence graph cannot be drawn

5.10 Which of the following concurrency control protocols ensure both conflict serialzability and
freedom from deadlock?
I. 2-phase locking
II. Time-stamp ordering
GATE | GATE CS 2010 | Question 20

(A) I only
(B) II only
(C) Both I and II
(D) Neither I nor II

Page | 59 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

5.11 Consider the following schedule for transactions T1, T2 and T3:

Which one of the schedules below is the correct serialization of the above?
GATE | GATE CS 2010 | Question 42

(A) T1->>T3->>T2
(B) T2->>T1->>T3
(C) T2->>T3->>T1
(D) T3->>T1->>T2

5.12 Consider the following four schedules due to three transactions (indicated by the subscript) using
read and write on a data item x, denoted by r(x) and w(x) respectively. Which one of them is conflict
serializable.

GATE | GATE-CS-2014-(Set-1) | Question 65

(A) A
(B) B
(C) C
(D) D

Page | 60 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: TRANSACTIOM

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

5.13 Consider the following schedule S of transactions T1, T2, T3, T4:

Which one of the following statements is CORRECT?


GATE | GATE-CS-2014-(Set-2) | Question 65

(A) S is conflict-serializable but not recoverable


(B) S is not conflict-serializable but is recoverable
(C) S is both conflict-serializable and recoverable
(D) S is neither conflict-serializable nor is it recoverable

5.14 Consider the transactions T1, T2, and T3 and the schedules S1 and S2 given below.
T1: r1(X); r1(Z); w1(X); w1(Z)
T2: r2(Y); r2(Z); w2(Z)
T3: r3(Y); r3(X); w3(Y)
S1: r1(X); r3(Y); r3(X); r2(Y); r2(Z);
w3(Y); w2(Z); r1(Z); w1(X); w1(Z)
S2: r1(X); r3(Y); r2(Y); r3(X); r1(Z);
r2(Z); w3(Y); w1(X); w2(Z); w1(Z)
Which one of the following statements about the schedules is TRUE?
GATE | GATE-CS-2014-(Set-3) | Question 65

(A) Only S1 is conflict-serializable.


(B) Only S2 is conflict-serializable.
(C) Both S1 and S2 are conflict-serializable.
(D) Neither S1 nor S2 is conflict-serializable.

Page | 61 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

5.15 Consider the following log sequence of two transactions on a bank account, with initial balance
12000, that transfer 2000 to a mortgage payment and then apply a 5% interest.
1. T1 start
2. T1 B old=12000 new=10000
3. T1 M old=0 new=2000
4. T1 commit
5. T2 start
6. T2 B old=10000 new=10500
7. T2 commit
Suppose the database system crashes just before log record 7 is written. When the system is restarted,
which one statement is true of the recovery procedure?
GATE | GATE-CS-2006 | Question 85

(A) We must redo log record 6 to set B to 10500


(B) We must undo log record 6 to set B to 10000 and then redo log records 2 and 3.
(C) We need not redo log records 2 and 3 because transaction T1 has committed.
(D) We can apply redo and undo operations in arbitrary order because they are idempotent

5.16 Which of the following scenarios may lead to an irrecoverable error in a database system ?
GATE | GATE-CS-2003 | Question 29

(A) A transaction writes a data item after it is read by an uncommitted transaction


(B) A transaction reads a data item after it is read by an uncommitted transaction
(C) A transaction reads a data item after it is written by a committed transaction
(D) A transaction reads a data item after it is written by an uncommitted transaction

Page | 62 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: TRANSACTIOM

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

5.17 Consider three data items D1, D2 and D3 and the following execution schedule of transactions
T1, T2 and T3. In the diagram, R(D) and W(D) denote the actions reading and writing the data item D
respectively.

Which of the following statements is correct?


GATE | GATE-CS-2003 | Question 90

(A) The schedule is serializable as T2; T3; T1


(B) The schedule is serializable as T2; T1; T3
(C) The schedule is serializable as T3; T2; T1
(D) The schedule is not serializable

5.19 Consider the following schedule S of transactions T1 and T2:


T1 T2

Read (A)Temp = 0.2*A


Write(A)

Read(A)A = A – 10 Read(B)

Write(A)Read(B)
B = B + 10
Write(B) B = B + TempWrite(B)
GATE | GATE-IT-2004 | Question 77

(A) S is serializable only as T1, T2


(B) S is serializable only as T2, T1
(C) S is serializable both as T1, T2 and T2, T1
(D) S is serializable either as T1 or as T2
(E) None of these

Page | 63 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

5.20 Consider the following three schedules of transactions T1, T2 and T3. [Notation: In the
following NYO represents the action Y (R for read, W for write) performed by transaction N on
object O.]
(S1) 2RA 2WA 3RC 2WB 3WA 3WC 1RA 1RB 1WA 1WB
(S2) 3RC 2RA 2WA 2WB 3WA 1RA 1RB 1WA 1WB 3WC
(S3) 2RA 3RC 3WA 2WA 2WB 3WC 1RA 1RB 1WA 1WB
Which of the following statements is TRUE?
GATE | Gate IT 2008 | Question 61

(A) S1, S2 and S3 are all conflict equivalent to each other


(B) No two of S1, S2 and S3 are conflict equivalent to each other
(C) S2 is conflict equivalent to S3, but not to S1
(D) S1 is conflict equivalent to S2, but not to S3

5.18 Which level of locking provides the highest degree of concurrency in a relational data base?
GATE | GATE-IT-2004 | Question 21

(A) Page
(B) Table
(C) Row
(D) Page, table and row level locking allow the same degree of concurrency

Page | 64 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: FILE STRUCTURE

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

6.1 With reference to the B+ tree index of order 1 shown below, the minimum number of nodes
(including the root node) that must be fetched in order to satisfy the following query: “Get all records
with a search key greater than or equal to 7 and less than 15” is ________

GATE | GATE-CS-2015 (Set 2) | Question 65

(A) 4
(B) 5
(C) 6
(D) 7

6.2 Consider B+ tree in which the search key is 12 bytes long, block size is 1024 bytes, record pointer
is 10 bytes long and block pointer is 8 bytes long. The maximum number of keys that can be
accommodated in each non-leaf node of the tree is
GATE | GATE-CS-2015 (Set 3) | Question 56

(A) 49
(B) 50
(C) 51
(D) 52

Page | 65 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

6.3 An index is clustered, if


GATE | GATE CS 2013 | Question 15

(A) it is on a set of fields that form a candidate key.


(B) it is on a set of fields that include the primary key.
(C) the data records of the file are organized in the same order as the data entries of the index.
(D) the data records of the file are organized not in the same order as the data entries of the index.

6.4 Consider a B+-tree in which the maximum number of keys in a node is 5. What is the minimum
number of keys in any non-root node?
GATE | GATE CS 2010 | Question 18

(A) 1
(B) 2
(C) 3
(D) 4

Page | 66 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: FILE STRUCTURE

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

6.5 A FAT (file allocation table) based file system is being used and the total overhead of each entry
in the FAT is 4 bytes in size. Given a 100 x 106 bytes disk on which the file system is stored and data
block size is 103 bytes, the maximum size of a file that can be stored on this disk in units of 10 6 bytes
is ____________.
GATE | GATE-CS-2014-(Set-2) | Question 65

(A) 99.55 to 99.65


(B) 100.5 to 101.4
(C) 97.2 to 98.5
(D) 89.1 to 91.2

6.6 In the index allocation scheme of blocks to a file, the maximum possible size of the file depends
on :
GATE | GATE-CS-2002 | Question 47

(A) the size of the blocks, and the size of the address of the blocks.
(B) the number of blocks used for the index, and the size of the blocks.
(C) the size of the blocks, the number of blocks used for the index, and the size of the address of the
blocks.
(D) None of these

Page | 67 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

TOPIC: FILE STRUCTURE

Date : Hour : Mark : /10

Signature of the Student Mentor : Signature of Subject In – Charge:

6.7 A database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400
records and occupies 20 disk blocks. These two tables have to be joined as per a specified join
condition that needs to be evaluated for every pair of records from these two tables. The memory
buffer space available can hold exactly one block of records for T1 and one block of records for T2
simultaneously at any point in time. No index is available on either table.
If Nested-loop join algorithm is employed to perform the join, with the most appropriate choice of
table to be used in outer loop, the number of block accesses required for reading the data are
GATE | Gate IT 2005 | Question 84
Q 82_Part A

(A) 800000
(B) 40080
(C) 32020
(D) 100

Page | 68 II IT 2019 – 2020 EVEN


CS8492 – Database Management Systems

6.8 A database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400
records and occupies 20 disk blocks. These two tables have to be joined as per a specified join
condition that needs to be evaluated for every pair of records from these two tables. The memory
buffer space available can hold exactly one block of records for T1 and one block of records for T2
simultaneously at any point in time. No index is available on either table.
If, instead of Nested-loop join, Block nested-loop join is used, again with the most appropriate choice
of table in the outer loop, the reduction in number of block accesses required for reading the data will
be
GATE | Gate IT 2005 | Question 85
Q82_Part B

(A) 0
(B) 30400
(C) 38400
(D) 798400

Page | 69 II IT 2019 – 2020 EVEN

You might also like