0% found this document useful (0 votes)
7 views81 pages

DBMS

The document provides an overview of B-trees, including their structure, properties, and various questions from GATE exams related to B-trees. It covers topics such as insertion, deletion, and the characteristics of B-trees in database indexing. Additionally, it includes specific questions and answer keys from multiple years of GATE examinations.

Uploaded by

sumanxlata
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)
7 views81 pages

DBMS

The document provides an overview of B-trees, including their structure, properties, and various questions from GATE exams related to B-trees. It covers topics such as insertion, deletion, and the characteristics of B-trees in database indexing. Additionally, it includes specific questions and answer keys from multiple years of GATE examinations.

Uploaded by

sumanxlata
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/ 81

5 Databases (268)

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.

5.1 B Tree (29)

5.1.1 B Tree: GATE CSE 1989 | Question: 12a

The below figure shows a tree where only key values are indicated in the records. Each block can hold
upto three records. A record with a key value is inserted into the tree. Obtain the modified tree
after insertion.

descriptive gate1989 databases b-tree

Answer key☟

5.1.2 B Tree: GATE CSE 1994 | Question: 14a

Consider - tree of order shown in figure. (A - tree of order contains between and keys in
each node)
Draw the resulting - tree after is inserted in the figure below.

gate1994 databases b-tree normal descriptive

Answer key☟

5.1.3 B Tree: GATE CSE 1994 | Question: 14b

For a - tree of order with leaf nodes, the number of nodes accessed during a search is .

gate1994 databases b-tree normal descriptive

Answer key☟

5.1.4 B Tree: GATE CSE 1997 | Question: 19

A - tree of order is a tree in which each internal node has between and key values. An internal
node with key values has children. The root (if it is an internal node) has between and key
values. The distance of a node from the root is the length of the path from the root to the node. All leaves are at the
same distance from the root. The height of the tree is the distance of a leaf from the root.

A. What is the total number of key values in the internal nodes of a -tree with leaves ( )?
B. What is the maximum number of internal nodes in a - tree of order with leaves?
C. What is the minimum number of leaves in a -tree of order and height ?

gate1997 databases b-tree normal descriptive

Answer key☟

5.1.5 B Tree: GATE CSE 1999 | Question: 1.25

Which of the following is correct?

A. B-trees are for storing data on disk and B trees are for main memory.
B. Range queries are faster on B trees.
C. B-trees are for primary indexes and B trees are for secondary indexes.
D. The height of a B tree is independent of the number of records.

gate1999 databases b-tree normal

Answer key☟

5.1.6 B Tree: GATE CSE 1999 | Question: 21

Consider a B-tree with degree , that is, the number of children, , of any internal node (except the root) is
such that . Derive the maximum and minimum number of records in the leaf nodes for
such a B-tree with height Assume that the root of a tree is at height

gate1999 databases b-tree normal descriptive

Answer key☟

5.1.7 B Tree: GATE CSE 2000 | Question: 1.22, UGCNET-June2012-II: 11

B -trees are preferred to binary trees in databases because

A. Disk capacities are greater than memory capacities


B. Disk access is much slower than memory access
C. Disk data transfer rates are much less than memory data transfer rates
D. Disks are more reliable than memory

gatecse-2000 databases b-tree normal ugcnetcse-june2012-paper2

Answer key☟

5.1.8 B Tree: GATE CSE 2000 | Question: 21

(a) Suppose you are given an empty tree where each node (leaf and internal) can store up to key
values. Suppose values are inserted, in order, into the tree. Show the tree pictorially

i. after insertions, and


ii. after all insertions

Do NOT show intermediate stages.


(b) Suppose instead of splitting a node when it is full, we try to move a value to the left sibling. If there is no
left sibling, or the left sibling is full, we split the node. Show the tree after values have been inserted.
Assume, as in (a) that each node can hold up to keys.
(c) In general, suppose a tree node can hold a maximum of keys,and you insert a long sequence of keys in
increasing order. Then what approximately is the average number of keys in each leaf level node.
i. in the normal case, and
ii. with the insertion as in (b).

gatecse-2000 databases b-tree normal descriptive

Answer key☟

5.1.9 B Tree: GATE CSE 2001 | Question: 22

We wish to construct a tree with fan-out (the number of pointers per node) equal to for the following
set of key values:

Assume that the tree is initially empty and the values are added in the order given.

a. Show the tree after insertion of , after insertion of , and after insertion of . Intermediate trees need not be
shown.
b. The key values and are now deleted from the tree in that order show the tree after each deletion.

gatecse-2001 databases b-tree normal descriptive

Answer key☟

5.1.10 B Tree: GATE CSE 2002 | Question: 17

a. The following table refers to search items for a key in -trees and trees.

A successful search means that the key exists in the database and unsuccessful means that it is not present in
the database. Each of the entries and can have a value of either Constant or Variable.
Constant means that the search time is the same, independent of the specific key value, where variable means
that it is dependent on the specific key value chosen for the search.
Give the correct values for the entries and (for example

b. Relation has the following view defined on it:


CREATE VIEW V AS
(SELECT R1.A,R2.B
FROM R AS R1, R as R2
WHERE R1.B=R2.A)

i. The current contents of relation are shown below. What are the contents of the view ?

ii. The tuples and are now inserted into What are the additional tuples that are inserted in
?
gatecse-2002 databases b-tree normal descriptive

Answer key☟

5.1.11 B Tree: GATE CSE 2002 | Question: 2.23, UGCNET-June2012-II: 26

A - tree index is to be built on the Name attribute of the relation STUDENT. Assume that all the student
names are of length bytes, disk blocks are of size bytes, and index pointers are of size bytes. Given
the scenario, what would be the best choice of the degree (i.e. number of pointers per node) of the - tree?

A. B. C. D.
gatecse-2002 databases b-tree normal ugcnetcse-june2012-paper2

Answer key☟

5.1.12 B Tree: GATE CSE 2003 | Question: 65

Consider the following tree (i.e., B-tree with a minimum degree of two) in which each data item is
a letter. The usual alphabetical ordering of letters is used in constructing the tree.

What is the result of inserting in the above tree?

A. B.
D. None of the above

C.
gatecse-2003 databases b-tree normal

Answer key☟

5.1.13 B Tree: GATE CSE 2004 | Question: 52

The order of an internal node in a tree index is the maximum number of children it can have. Suppose
that a child pointer takes bytes, the search field value takes bytes, and the block size is bytes.
What is the order of the internal node?

A. B. C. D.
gatecse-2004 databases b-tree normal

Answer key☟

5.1.14 B Tree: GATE CSE 2005 | Question: 28

Which of the following is a key factor for preferring -trees to binary search trees for indexing database
relations?

A. Database relations have a large number of records


B. Database relations are sorted on the primary key
C. -trees require less memory than binary search trees
D. Data transfer from disks is in blocks

gatecse-2005 databases b-tree normal

Answer key☟
5.1.15 B Tree: GATE CSE 2007 | Question: 63, ISRO2016-59

The order of a leaf node in a - tree is the maximum number of (value, data record pointer) pairs it can
hold. Given that the block size is , data record pointer is long, the value field is
long and a block pointer is long, what is the order of the leaf node?

A. B. C. D.
gatecse-2007 databases b-tree normal isro2016

Answer key☟

5.1.16 B Tree: GATE CSE 2008 | Question: 41

A B-tree of order is built from scratch by successive insertions. What is the maximum number of node
splitting operations that may take place?

A. B. C. D.
gatecse-2008 databases b-tree normal

Answer key☟

5.1.17 B Tree: GATE CSE 2009 | Question: 44

The following key values are inserted into a - tree in which order of the internal nodes is , and that
of the leaf nodes is , in the sequence given below. The order of internal nodes is the maximum number of
tree pointers in each node, and the order of leaf nodes is the maximum number of data items that can be stored in
it. The - tree is initially empty
, , , , , ,
The maximum number of times leaf nodes would get split up as a result of these insertions is

A. B. C. D.
gatecse-2009 databases b-tree normal

Answer key☟

5.1.18 B Tree: GATE CSE 2010 | Question: 18

Consider a -tree in which the maximum number of keys in a node is . What is the minimum number of
keys in any non-root node?

A. B. C. D.
gatecse-2010 databases b-tree easy

Answer key☟

5.1.19 B Tree: GATE CSE 2015 Set 2 | Question: 6

With reference to the B+ tree index of order 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 and less than " is ______.

gatecse-2015-set2 databases b-tree normal numerical-answers

Answer key☟
5.1.20 B Tree: GATE CSE 2015 Set 3 | Question: 46

Consider a B+ tree in which the search key is long, block size is , record pointer is
long and the block pointer is long. The maximum number of keys that can be accommodated
in each non-leaf node of the tree is ______.

gatecse-2015-set3 databases b-tree normal numerical-answers

Answer key☟

5.1.21 B Tree: GATE CSE 2016 Set 2 | Question: 21

B+ Trees are considered BALANCED because.

A. The lengths of the paths from the root to all leaf nodes are all equal.
B. The lengths of the paths from the root to all leaf nodes differ from each other by at most .
C. The number of children of any two non-leaf sibling nodes differ by at most .
D. The number of records in any two leaf nodes differ by at most .

gatecse-2016-set2 databases b-tree normal

Answer key☟

5.1.22 B Tree: GATE CSE 2017 Set 2 | Question: 49

In a B+ Tree , if the search-key value is bytes long , the block size is bytes and the pointer size is
, then the maximum order of the B+ Tree is ____

gatecse-2017-set2 databases b-tree numerical-answers normal

Answer key☟

5.1.23 B Tree: GATE CSE 2019 | Question: 14

Which one of the following statements is NOT correct about the B+ tree data structure used for creating an
index of a relational database table?

A. B+ Tree is a height-balanced tree


B. Non-leaf nodes have pointers to data records
C. Key values in each node are kept in sorted order
D. Each leaf node has a pointer to the next leaf node

gatecse-2019 databases b-tree 1-mark

Answer key☟

5.1.24 B Tree: GATE CSE 2024 | Set 1 | Question: 11

In a tree, the requirement of at least half-full node occupancy is relaxed for which one of the
following cases?

A. Only the root node B. All leaf nodes


C. All internal nodes D. Only the leftmost leaf node
gatecse2024-set1 databases b-tree

Answer key☟

5.1.25 B Tree: GATE IT 2004 | Question: 79

Consider a table in a relational database with a key field . A -tree of order is used as an access
structure on , where denotes the maximum number of tree pointers in a B-tree index node. Assume that
is long; disk block size is ; each data pointer PD is bytes long and each block pointer PB is
bytes long. In order for each -tree node to fit in a single disk block, the maximum value of is

A. B. C. D.
gateit-2004 databases b-tree normal
Answer key☟

5.1.26 B Tree: GATE IT 2005 | Question: 23, ISRO2017-67

A B-Tree used as an index for a large database table has four levels including the root node. If a new key is
inserted in this index, then the maximum number of nodes that could be newly created in the process are

A. B. C. D.
gateit-2005 databases b-tree normal isro2017

Answer key☟

5.1.27 B Tree: GATE IT 2006 | Question: 61

In a database file structure, the search key field is long, the block size is , a record pointer
is and a block pointer is . The largest possible order of a non-leaf node in a tree
implementing this file structure is

A. B. C. D.
gateit-2006 databases b-tree normal

Answer key☟

5.1.28 B Tree: GATE IT 2007 | Question: 84

Consider the tree in the adjoining figure, where each node has at most two keys and three links.

Keys and then are inserted into this tree in that order. Exactly how many of the following nodes
(disregarding the links) will be present in the tree after the two insertions?

A. B. C. D.
gateit-2007 databases b-tree normal

Answer key☟

5.1.29 B Tree: GATE IT 2007 | Question: 85

Consider the tree in the adjoining figure, where each node has at most two keys and three links.

Keys and then are inserted into this tree in that order. Now the key is deleted from the tree
resulting after the two insertions made earlier. Consider the following statements about the tree resulting after
this deletion.

i. The height of the tree remains the same.

ii. The node


(disregarding the links) is present in the tree.
iii. The root node remains unchanged (disregarding the links).

Which one of the following options is true?

A. Statements (i) and (ii) are true B. Statements (ii) and (iii) are true
C. Statements (iii) and (i) are true D. All the statements are false
gateit-2007 databases b-tree normal

Answer key☟

5.2 Candidate Key (5)

5.2.1 Candidate Key: GATE CSE 1994 | Question: 3.7

An instance of a relational scheme has distinct values for attribute . Can you conclude that
is a candidate key for

gate1994 databases easy database-normalization candidate-key descriptive

Answer key☟

5.2.2 Candidate Key: GATE CSE 2011 | Question: 12

Consider a relational table with a single record for each registered student with the following attributes:

1. Unique registration number for each registered student


2. Unique identity number, unique at the national level for each citizen
3. Unique account number at the bank. A student can have multiple accounts or joint
accounts. This attribute stores the primary account number.
4. Name of the student
5. Room number of the hostel

Which of the following options is INCORRECT?

A. is a candidate key
B. can be a primary key
C. is a candidate key if all students are from the same country
D. If is a super key such that is then is also a superkey

gatecse-2011 databases normal candidate-key

Answer key☟

5.2.3 Candidate Key: GATE CSE 2014 Set 2 | Question: 21

The maximum number of superkeys for the relation schema with as the key is _____.

gatecse-2014-set2 databases numerical-answers easy candidate-key

Answer key☟

5.2.4 Candidate Key: GATE CSE 2014 Set 2 | Question: 22

Given an instance of the STUDENTS relation as shown as below

For to be a key for this instance, the value should NOT be equal to______.

gatecse-2014-set2 databases numerical-answers easy candidate-key

Answer key☟
5.2.5 Candidate Key: GATE CSE 2014 Set 3 | Question: 22

A prime attribute of a relation scheme is an attribute that appears

A. in all candidate keys of B. in some candidate key of


C. in a foreign key of D. only in the primary key of
gatecse-2014-set3 databases easy candidate-key

Answer key☟

5.3 Conflict Serializable (8)

5.3.1 Conflict Serializable: GATE CSE 2014 Set 1 | Question: 29

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

A. ; ; ; ; ;
B. ; ; ; ; ;
C. ; ; ; ; ;
D. ; ; ; ; ;

gatecse-2014-set1 databases transaction-and-concurrency conflict-serializable normal

Answer key☟

5.3.2 Conflict Serializable: GATE CSE 2014 Set 2 | Question: 29

Consider the following schedule S of transactions

Which one of the following statements is CORRECT?

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 not is it recoverable

gatecse-2014-set2 databases transaction-and-concurrency conflict-serializable normal

Answer key☟

5.3.3 Conflict Serializable: GATE CSE 2014 Set 3 | Question: 29

Consider the transactions and the schedules given below.


Which one of the following statements about the schedules is TRUE?

A. Only is conflict-serializable. B. Only is conflict-serializable.


C. B o t h and are conflict- D. Neither nor is conflict-
serializable. serializable.
gatecse-2014-set3 databases transaction-and-concurrency conflict-serializable normal

Answer key☟

5.3.4 Conflict Serializable: GATE CSE 2017 Set 2 | Question: 44

Two transactions and are given as

where denotes a operation by transaction on a variable and denotes a operation


by transaction on a variable . The total number of conflict serializable schedules that can be formed by and
is ______

gatecse-2017-set2 databases transaction-and-concurrency numerical-answers conflict-serializable

Answer key☟

5.3.5 Conflict Serializable: GATE CSE 2021 Set 1 | Question: 32

Let and denote read and write operations respectively on a data item by a transaction .
Consider the following two schedules.

Which one of the following options is correct?

A. is conflict serializable, and is not conflict serializable


B. is not conflict serializable, and is conflict serializable
C. Both and are conflict serializable
D. Niether nor is conflict serializable

gatecse-2021-set1 databases transaction-and-concurrency conflict-serializable 2-marks

Answer key☟

5.3.6 Conflict Serializable: GATE CSE 2021 Set 2 | Question: 32

Let be the following schedule of operations of three transactions , and in a relational database
system:

Consider the statements and below:

: is conflict-serializable.
: If commits before finishes, then is recoverable.

Which one of the following choices is correct?

A. Both and are true B. is true and is false


C. is false and is true D. Both and are false
gatecse-2021-set2 databases transaction-and-concurrency conflict-serializable 2-marks

Answer key☟

5.3.7 Conflict Serializable: GATE CSE 2022 | Question: 29

Let and denote read and write operations on a data element by a transaction
respectively. Consider the schedule with four transactions.

Which one of the following serial schedules is conflict equivalent to

A. B.
C. D.
gatecse-2022 databases transaction-and-concurrency conflict-serializable 2-marks

Answer key☟

5.3.8 Conflict Serializable: GATE CSE 2024 | Set 1 | Question: 36

Consider the following read-write schedule over three transactions , and , where the subscripts in
the schedule indicate transaction IDs:

Which of the following transaction schedules is/are conflict equivalent to ?

A. B. C. D.
gatecse2024-set1 databases conflict-serializable multiple-selects

Answer key☟

5.4 Database Design (1)

5.4.1 Database Design: GATE CSE 1994 | Question: 3.11

State True or False with reason

Logical data independence is easier to achieve than physical data independence.

gate1994 databases normal database-design true-false

Answer key☟

5.5 Database Normalization (55)

5.5.1 Database Normalization: GATE CSE 1987 | Question: 2n

State whether the following statements are TRUE or FALSE:

A relation with schema satisfies the function dependency , The tuples and can both
be in simultaneously.

gate1987 databases database-normalization true-false

Answer key☟

5.5.2 Database Normalization: GATE CSE 1988 | Question: 12i

What are the three axioms of functional dependency for the relational databases given by Armstrong.

gate1988 normal descriptive databases database-normalization

Answer key☟

5.5.3 Database Normalization: GATE CSE 1988 | Question: 12iia

Using Armstrong’s axioms of functional dependency derive the following rules:


(Note: denotes is functionally dependent on , denotes is subset of , and means derives).

gate1988 easy descriptive databases database-normalization

Answer key☟

5.5.4 Database Normalization: GATE CSE 1988 | Question: 12iib

Using Armstrong’s axioms of functional dependency derive the following rules:

(Note: denotes is functionally dependent on , denotes is subset of , and means derives).

gate1988 normal descriptive databases database-normalization

Answer key☟

5.5.5 Database Normalization: GATE CSE 1988 | Question: 12iic

Using Armstrong’s axioms of functional dependency derive the following rules:

(Note: denotes is functionally dependent on , denotes is subset of , and means derives).

gate1988 normal descriptive databases database-normalization

Answer key☟

5.5.6 Database Normalization: GATE CSE 1990 | Question: 2-iv

Match the pairs in the following questions:

gate1990 match-the-following database-normalization databases

Answer key☟

5.5.7 Database Normalization: GATE CSE 1990 | Question: 3-ii

Indicate which of the following statements are true:


A relational database which is in NF may still have undesirable data redundancy because there may exist:

A. Transitive functional dependencies


B. Non-trivial functional dependencies involving prime attributes on the right-side.
C. Non-trivial functional dependencies involving prime attributes only on the left-side.
D. Non-trivial functional dependencies involving only prime attributes.

gate1990 normal databases database-normalization multiple-selects

Answer key☟

5.5.8 Database Normalization: GATE CSE 1994 | Question: 3.6

State True or False with reason

There is always a decomposition into Boyce-Codd normal form (BCNF) that is lossless and dependency
preserving.
gate1994 databases database-normalization easy true-false

Answer key☟

5.5.9 Database Normalization: GATE CSE 1995 | Question: 26

Consider the relation scheme with the following functional dependencies:

A. Show that the scheme is in but not in .


B. Determine the minimal keys of relation .

gate1995 databases database-normalization normal descriptive

Answer key☟

5.5.10 Database Normalization: GATE CSE 1997 | Question: 6.9

For a database relation , where the domains include only atomic values, only the
following functional dependencies and those that can be inferred from them hold

This relation is

A. in first normal form but not in second normal form B. in second normal form but not in first normal form
C. in third normal form D. none of the above
gate1997 databases database-normalization normal

Answer key☟

5.5.11 Database Normalization: GATE CSE 1998 | Question: 1.34

Which normal form is considered adequate for normal relational database design?

A. B. C. D.
gate1998 databases database-normalization easy

Answer key☟

5.5.12 Database Normalization: GATE CSE 1998 | Question: 26

Consider the following database relations containing the attributes

Book_id
Subject_Category_of_book
Name_of_Author
Nationality_of_Author

With Book_id as the primary key.

a. What is the highest normal form satisfied by this relation?


b. Suppose the attributes Book_title and Author_address are added to the relation, and the primary key is changed
to {Name_of_Author, Book_title}, what will be the highest normal form satisfied by the relation?

gate1998 databases database-normalization normal descriptive

Answer key☟

5.5.13 Database Normalization: GATE CSE 1999 | Question: 1.24

L e t be a relation scheme with the following dependencies


. Which one of the following is a key for ?

A. CD B. EC C. AE D. AC
gate1999 databases database-normalization easy

Answer key☟

5.5.14 Database Normalization: GATE CSE 1999 | Question: 2.7, UGCNET-June2014-III: 25

Consider the schema and the dependencies and . Let


be a decomposition such that . The decomposition is

A. not in B. in but not


C. in but not in D. in both and
gate1999 databases database-normalization normal ugcnetjune2014iii

Answer key☟

5.5.15 Database Normalization: GATE CSE 2000 | Question: 2.24

Given the following relation instance.

Which of the following functional dependencies are satisfied by the instance?

A. and B. and
C. and D. and
gatecse-2000 databases database-normalization easy

Answer key☟

5.5.16 Database Normalization: GATE CSE 2001 | Question: 2.23

is a relation. Which of the following does not have a lossless join, dependency preserving
decomposition?

A. B.
C. D.
gatecse-2001 databases database-normalization normal

Answer key☟

5.5.17 Database Normalization: GATE CSE 2002 | Question: 1.19

Relation with an associated set of functional dependencies, , is decomposed into . The


redundancy (arising out of functional dependencies) in the resulting set of relations is

A. Zero
B. More than zero but less than that of an equivalent decomposition
C. Proportional to the size of
D. Indeterminate

gatecse-2002 databases database-normalization normal

Answer key☟

5.5.18 Database Normalization: GATE CSE 2002 | Question: 16

For relation R = (L, M, N, O, P), the following dependencies hold:


and
R is decomposed into R1 = (L, M, N, P) and R2 = (M, O).

A. Is the above decomposition a lossless-join decomposition? Explain.


B. Is the above decomposition dependency-preserving? If not, list all the dependencies that are not preserved.
C. What is the highest normal form satisfied by the above decomposition?

gatecse-2002 databases database-normalization normal descriptive

Answer key☟

5.5.19 Database Normalization: GATE CSE 2002 | Question: 2.24

Relation is decomposed using a set of functional dependencies, , and relation is decomposed using
another set of functional dependencies, . One decomposition is definitely , the other is definitely
, 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 and are available).

A. Dependency-preservation B. Lossless-join
C. definition D. definition
gatecse-2002 databases database-normalization easy

Answer key☟

5.5.20 Database Normalization: GATE CSE 2002 | Question: 2.25

From the following instance of a relation schema , we can conclude that:

A. functionally determines and functionally determines


B. functionally determines and does not functionally determine
C. does not functionally determine
D. does not functionally determine and does not functionally determine

gatecse-2002 databases database-normalization

Answer key☟

5.5.21 Database Normalization: GATE CSE 2003 | Question: 85

Consider the following functional dependencies in a database.

The relation (Roll_number, Name, Date_of_birth, Age) is

A. in second normal form but not in B. in third normal form but not in
third normal form BCNF
C. in BCNF D. in none of the above
gatecse-2003 databases database-normalization normal

Answer key☟
5.5.22 Database Normalization: GATE CSE 2004 | Question: 50

The relation scheme has the following


functional dependencies:

name, courseNo, grade


rollNo, courseNo grade
name rollNo
rollNo name

The highest normal form of this relation scheme is

A. B. C. D.
gatecse-2004 databases database-normalization normal

Answer key☟

5.5.23 Database Normalization: GATE CSE 2005 | Question: 29, UGCNET-June2015-III: 9

Which one of the following statements about normal forms is

A. is stricter than
B. Lossless, dependency-preserving decomposition into is always possible
C. Lossless, dependency-preserving decomposition into is always possible
D. Any relation with two attributes is in

gatecse-2005 databases database-normalization easy ugcnetcse-june2015-paper3

Answer key☟

5.5.24 Database Normalization: GATE CSE 2005 | Question: 78

Consider a relation scheme on which the following functional dependencies hold:


{ , , , }. What are the candidate keys R?

A. B. C. D.
gatecse-2005 databases database-normalization easy

Answer key☟

5.5.25 Database Normalization: GATE CSE 2006 | Question: 70

The following functional dependencies are given:

Which one of the following options is false?

A. B.
C. D.
gatecse-2006 databases database-normalization normal

Answer key☟

5.5.26 Database Normalization: GATE CSE 2007 | Question: 62, UGCNET-June2014-II: 47

Which one of the following statements is ?

A. Any relation with two attributes is in


B. A relation in which every key has only one attribute is in
C. A prime attribute can be transitively dependent on a key in a relation
D. A prime attribute can be transitively dependent on a key in a relation
gatecse-2007 databases database-normalization normal ugcnetcse-june2014-paper2

Answer key☟

5.5.27 Database Normalization: GATE CSE 2008 | Question: 69

Consider the following relational schemes for a library database:

Book (Title, Author, Catalog_no, Publisher, Year, Price)


Collection(Title, Author, Catalog_no)

with the following functional dependencies:

I.
II.
III.

Assume is the key for both schemes. Which of the following statements is ?

A. Both Book and Collection are in B. Both Book and Collection are in only
C. Book is in and Collection in D. Both Book and Collection are in only
gatecse-2008 databases database-normalization normal

Answer key☟

5.5.28 Database Normalization: GATE CSE 2012 | Question: 2

Which of the following is TRUE?

A. Every relation in is also in


B. A relation is in if every non-prime attribute of is fully functionally dependent on every key of
C. Every relation in is also in
D. No relation can be in both and

gatecse-2012 databases easy database-normalization

Answer key☟

5.5.29 Database Normalization: GATE CSE 2013 | Question: 54

Relation has eight attributes . Fields of contain only atomic values. =


is a set of functional dependencies so that is
exactly the set of that hold for .
How many candidate keys does the relation have?

A. B. C. D.
gatecse-2013 databases database-normalization normal

Answer key☟

5.5.30 Database Normalization: GATE CSE 2013 | Question: 55

Relation has eight attributes . Fields of contain only atomic values.


is a set of functional dependencies so
that is exactly the set of that hold for .
The relation is

A. in , but not in . B. in , but not in .


C. in , but not in . D. in .
gatecse-2013 databases database-normalization normal

Answer key☟
5.5.31 Database Normalization: GATE CSE 2014 Set 1 | Question: 21

Consider the relation scheme and the set of functional


dependencies

on . What is the key for ?

A. B. C. D.
gatecse-2014-set1 databases database-normalization normal

Answer key☟

5.5.32 Database Normalization: GATE CSE 2014 Set 1 | Question: 30

Given the following two statements:


S1: Every table with two single-valued attributes is in and
S2: is a minimal cover for the set of functional dependencies
.
Which one of the following is CORRECT?

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.
gatecse-2014-set1 databases database-normalization normal

Answer key☟

5.5.33 Database Normalization: GATE CSE 2015 Set 3 | Question: 20

Consider the relation with the following set of functional dependencies

Which of the following is the trivial functional dependency in , where is closure to F?

A. B.
C. D.
gatecse-2015-set3 databases database-normalization easy

Answer key☟

5.5.34 Database Normalization: GATE CSE 2016 Set 1 | Question: 21

Which of the following is NOT a superkey in a relational schema with attributes and primary
key ?

A. B. C. D.
gatecse-2016-set1 databases database-normalization easy

Answer key☟

5.5.35 Database Normalization: GATE CSE 2016 Set 1 | Question: 23

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

The primary key is '


and the following functional dependencies exist in the schema.
The database is redesigned to use the following schemas

Which is the weakest normal form that the new database satisfies, but the old one does not?

A. B. C. D.
gatecse-2016-set1 databases database-normalization normal

Answer key☟

5.5.36 Database Normalization: GATE CSE 2017 Set 1 | Question: 16

The following functional dependencies hold true for the relational schema :

Which of the following is irreducible equivalent for this set of functional dependencies?

A. B. C. D.

gatecse-2017-set1 databases database-normalization normal

Answer key☟

5.5.37 Database Normalization: GATE CSE 2018 | Question: 42

Consider the following four relational schemas. For each schema , all non-trivial functional dependencies are
listed, The bolded attributes are the respective primary keys.
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
Registration (rollno, coursid, email)
Non-trivial functional dependencies:
rollno, courseid email
email rollno
Registration (rollno, courseid, marks, grade)
Non-trivial functional dependencies:
rollno, courseid, marks, grade
marks grade
Registration (rollno, courseid, credit)
Non-trivial functional dependencies:
rollno, courseid credit
courseid credit
Which one of the relational schemas above is in but not in ?

A. B. C. D.
gatecse-2018 databases database-normalization normal 2-marks

Answer key☟

5.5.38 Database Normalization: GATE CSE 2019 | Question: 32

Let the set of functional dependencies hold on a relation schema


. is not in BCNF. Suppose is decomposed into two schemas and , where
and .
Consider the two statements given below.

I. Both and are in BCNF


II. Decomposition of into and is dependency preserving and lossless

Which of the above statements is/are correct?

A. Both I and II B. I only C. II only D. Neither I nor II


gatecse-2019 databases database-normalization 2-marks

Answer key☟

5.5.39 Database Normalization: GATE CSE 2020 | Question: 36

Consider a relational table that is in , but not in BCNF. Which one of the following statements is
TRUE?

A. has a nontrivial functional dependency , where is not a superkey and is a prime attribute.
B. has a nontrivial functional dependency , where is not a superkey and is a non-prime attribute
and is not a proper subset of any key.
C. has a nontrivial functional dependency , where is not a superkey and is a non-prime attribute
and is a proper subset of some key
D. A cell in holds a set instead of an atomic value.

gatecse-2020 databases database-normalization 2-marks

Answer key☟

5.5.40 Database Normalization: GATE CSE 2021 Set 1 | Question: 33

Consider the relation with the following functional dependencies.

Consider the decomposition of the relation into the constituent relations according to the following two
decomposition schemes.

Which one of the following options is correct?

A. is a lossless decomposition, but is a lossy decomposition


B. is a lossy decomposition, but is a lossless decomposition
C. Both and are lossless decompositions
D. Both and are lossy decompositions

gatecse-2021-set1 databases database-normalization 2-marks

Answer key☟
5.5.41 Database Normalization: GATE CSE 2021 Set 2 | Question: 40

Suppose the following functional dependencies hold on a relation with attributes , and :

Which of the following functional dependencies can be inferred from the above functional dependencies?

A. B. C. D.
gatecse-2021-set2 multiple-selects databases database-normalization 2-marks

Answer key☟

5.5.42 Database Normalization: GATE CSE 2022 | Question: 21

Consider a relation with the following three functional dependencies.

The number of superkeys in the relation is ______________ .

gatecse-2022 numerical-answers databases database-normalization 1-mark

Answer key☟

5.5.43 Database Normalization: GATE CSE 2022 | Question: 4

In a relational data model, which one of the following statements is

A. A relation with only two attributes is always in


B. If all attributes of a relation are prime attributes, then the relation is in
C. Every relation has at least one non-prime attribute.
D. decompositions preserve functional dependencies.

gatecse-2022 databases database-normalization 1-mark

Answer key☟

5.5.44 Database Normalization: GATE CSE 2024 | Set 1 | Question: 12

Which of the following statements about a relation in first normal form is/are TRUE?

A. can have a multi-attribute key


B. cannot have a foreign key
C. cannot have a composite attribute
D. cannot have more than one candidate key

gatecse2024-set1 multiple-selects databases database-normalization

Answer key☟

5.5.45 Database Normalization: GATE CSE 2024 | Set 1 | Question: 34

The symbol indicates functional dependency in the context of a relational database. Which of the
following options is/are TRUE?

A. implies
B. implies
C. and implies
D. and implies

gatecse2024-set1 multiple-selects databases database-normalization

Answer key☟
5.5.46 Database Normalization: GATE CSE 2024 | Set 2 | Question: 46

A functional dependency is termed as a useful functional dependency if and only if it satisfies


all the following three conditions:

is not the empty set.


is not the empty set.
Intersection of and is the empty set.

For a relation with attributes, the total number of possible useful functional dependencies is __________.

gatecse2024-set2 numerical-answers databases database-normalization

Answer key☟

5.5.47 Database Normalization: GATE DS&AI 2024 | Question: 36

​Given the relational schema and the set of functional dependencies:

Which of the following functional dependencies can be derived from the above set?

A. B.
C. D.
gate-ds-ai-2024 databases database-normalization multiple-selects

Answer key☟

5.5.48 Database Normalization: GATE Data Science and Artificial Intelligence 2024 | Sample Paper | Question:
26

Given the following relation instances

Which of the following conditions is/are TRUE?

A. and
B. and
C. and
D. and

gateda-sample-paper-2024 database-normalization

Answer key☟

5.5.49 Database Normalization: GATE IT 2004 | Question: 75

A relation is defined with attributes empcode (unique), name, street, city, state and pincode. For
any pincode, there is only one city and state. Also, for any given street, city and state, there is just one
pincode. In normalization terms, is a relation in

A. only B. and hence also in


C. and hence also in and D. and hence also in ,
and
gateit-2004 databases database-normalization normal

Answer key☟

5.5.50 Database Normalization: GATE IT 2005 | Question: 22

A table has fields with the following functional dependencies

In terms of Normalization, this table is in

A. B. C. D. None of these
gateit-2005 databases database-normalization easy

Answer key☟

5.5.51 Database Normalization: GATE IT 2005 | Question: 70

In a schema with attributes and following set of functional dependencies are given

Which of the following functional dependencies is NOT implied by the above set?

A. B. C. D.
gateit-2005 databases database-normalization normal

Answer key☟

5.5.52 Database Normalization: GATE IT 2006 | Question: 60

Consider a relation R with five attributes and The following functional dependencies hold:
and
Which of the following is a candidate key for

A. B. C. D.
gateit-2006 databases database-normalization normal

Answer key☟

5.5.53 Database Normalization: GATE IT 2008 | Question: 61

Let be a relational schema with the following functional dependencies :


, , and . The decomposition of into

A. gives a lossless join, and is dependency preserving


B. gives a lossless join, but is not dependency preserving
C. does not give a lossless join, but is dependency preserving
D. does not give a lossless join and is not dependency preserving

gateit-2008 databases database-normalization normal

Answer key☟

5.5.54 Database Normalization: GATE IT 2008 | Question: 62

Let be a relational schema in which the following functional dependencies are


known to hold: and The relational schema is
A. in B. in , but not in
C. in , but not in D. not in
gateit-2008 databases database-normalization normal

Answer key☟

5.5.55 Database Normalization: GATE2001-1.23, UGCNET-June2012-III: 18

Consider a schema and functional dependencies and . Then the


decomposition of R into and is

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

gate1998 databases ugcnetcse-june2012-paper3 database-normalization

Answer key☟

5.6 ER Diagram (12)

5.6.1 ER Diagram: GATE CSE 2005 | Question: 75

Let and be two entities in an diagram with simple-valued attributes. and are two
relationships between and , where is one-to-many and is many-to-many. and do not
have any attributes of their own. What is the minimum number of tables required to represent this situation in the
relational model?

A. B. C. D.
gatecse-2005 databases er-diagram normal

Answer key☟

5.6.2 ER Diagram: GATE CSE 2008 | Question: 82

Consider the following diagram

The minimum number of tables needed to represent , , , , is

A. B. C. D.
gatecse-2008 databases er-diagram normal

Answer key☟

5.6.3 ER Diagram: GATE CSE 2008 | Question: 83

Consider the following diagram

The minimum number of tables needed to represent , , , , is


Which of the following is a correct attribute set for one of the tables for the minimum number of tables needed to
represent , , , , ?

A. B. C. D.
gatecse-2008 databases er-diagram normal
Answer key☟

5.6.4 ER Diagram: GATE CSE 2012 | Question: 14

Given the basic ER and relational models, which of the following is INCORRECT?

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

gatecse-2012 databases normal er-diagram

Answer key☟

5.6.5 ER Diagram: GATE CSE 2015 Set 1 | Question: 41

Consider an Entity-Relationship model in which entity sets and are connected by an


relationship . and are connected by a ( on the side of and on the side of )
relationship .

has two-singled attributes and of which is the key attribute. has two singled-valued attributes
and of which is the key attribute. has two single-valued attributes and of which is the
key attribute. The relationships do not have any attributes.

If a relational model is derived from the above model, then the minimum number of relations that would be
generated if all relation are in is________________.

gatecse-2015-set1 databases er-diagram normal numerical-answers

Answer key☟

5.6.6 ER Diagram: GATE CSE 2017 Set 2 | Question: 17

An ER model of a database consists of entity types and . These are connected by a relationship
which does not have its own attribute. Under which one of the following conditions, can the relational table
for R be merged with that of A?

A. Relationship is one-to-many and the participation of in is total


B. Relationship is one-to-many and the participation of in is partial
C. Relationship is many-to-one and the participation of in is total
D. Relationship is many-to-one and the participation of in is partial

gatecse-2017-set2 databases er-diagram normal

Answer key☟

5.6.7 ER Diagram: GATE CSE 2018 | Question: 11

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

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

gatecse-2018 databases er-diagram normal 1-mark

Answer key☟
5.6.8 ER Diagram: GATE CSE 2020 | Question: 14

Which one of the following is used to represent the supporting many-one relationships of a weak entity set in
an entity-relationship diagram?

A. Diamonds with double/bold border B. Rectangles with double/bold


border
C. Ovals with double/bold border D. Ovals that contain underlined
identifiers
gatecse-2020 databases er-diagram 1-mark

Answer key☟

5.6.9 ER Diagram: GATE CSE 2024 | Set 1 | Question: 10

Let be the specification: "Instructors teach courses. Students register for courses. Courses are allocated
classrooms. Instructors guide students." Which one of the following diagrams CORRECTLY represents
?

A. B. C. D.
gatecse2024-set1 databases er-diagram

Answer key☟

5.6.10 ER Diagram: GATE CSE 2024 | Set 2 | Question: 10

In the context of owner and weak entity sets in the (Entity-Relationship) data model, which one of the
following statements is TRUE?

A. The weak entity set MUST have total participation in the identifying relationship
B. The owner entity set MUST have total participation in the identifying relationship
C. Both weak and owner entity sets MUST have total participation in the identifying relationship
D. Neither weak entity set nor owner entity set MUST have total participation in the identifying relationship

gatecse2024-set2 databases er-diagram


Answer key☟

5.6.11 ER Diagram: GATE IT 2004 | Question: 73

Consider the following entity relationship diagram , where two entities and have a relation
of cardinality 1:m.

The attributes of are , and where is the key attribute. The attributes of are ,
and where is the key attribute and is a multi-valued attribute. Relation does not have any
attribute. A relational database containing minimum number of tables with each table satisfying the requirements of
the third normal form ( ) is designed from the above . The number of tables in the database is

A. B. C. D.
gateit-2004 databases er-diagram normal

Answer key☟

5.6.12 ER Diagram: GATE IT 2005 | Question: 21

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

A. Person B. Hotel Room C. Lodging D. None of these


gateit-2005 databases er-diagram easy

Answer key☟

5.7 Indexing (13)

5.7.1 Indexing: GATE CSE 1989 | Question: 4-xiv

For secondary key processing which of the following file organizations is preferred? Give a one line
justification:

A. Indexed sequential file B. Two-way linked list.


organization.
C. Inverted file organization. D. Sequential file organization.
gate1989 normal databases indexing descriptive

Answer key☟

5.7.2 Indexing: GATE CSE 1990 | Question: 10b

One giga bytes of data are to be organized as an indexed-sequential file with a uniform blocking factor
Assuming a block size of Kilo bytes and a block refrencing pointer size of bits, find out the number of
levels of indexing that would be required and the size of the index at each level. Determine also the size of the
master index. The referencing capability (fanout ratio) per block of index storage may be considered to be .

gate1990 databases indexing descriptive

Answer key☟

5.7.3 Indexing: GATE CSE 1993 | Question: 14

An (indexed sequential) file consists of records of size bytes each, including key field of size
bytes. An address of a disk block takes bytes. If the disk block size is bytes and there are
records, compute the size of the data and index areas in terms of number blocks. How many levels of do you
have for the index?

gate1993 databases indexing normal descriptive

Answer key☟

5.7.4 Indexing: GATE CSE 1998 | Question: 1.35

There are five records in a database.

There is an index file associated with this and it contains the values and . Which one of the fields is the
index built from?

A. Age B. Name C. Occupation D. Category


gate1998 databases indexing normal

Answer key☟

5.7.5 Indexing: GATE CSE 2008 | Question: 16, ISRO2016-60

A clustering index is defined on the fields which are of type

A. non-key and ordering B. non-key and non-ordering


C. key and ordering D. key and non-ordering
gatecse-2008 easy databases indexing isro2016

Answer key☟

5.7.6 Indexing: GATE CSE 2008 | Question: 70

Consider a file of records. Each record is long and its key field is of size . The file is
ordered on a non-key field, and the file organization is unspanned. The file is stored in a file system with
block size , and the size of a block pointer is . If the secondary index is built on the key field of
the file, and a multi-level index scheme is used to store the secondary index, the number of first-level and
second-level blocks in the multi-level index are respectively

A. and B. and C. and D. and


gatecse-2008 databases indexing normal

Answer key☟

5.7.7 Indexing: GATE CSE 2011 | Question: 39

Consider a relational table with sufficient number of records, having attributes and let
. Two queries and are given below.

where is a constant
where and are constants.

The database can be configured to do ordered indexing on or hashing on . Which of the following statements
is TRUE?

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 , but not on
D. Hashing will outperform ordered indexing on , but not on
gatecse-2011 databases indexing normal

Answer key☟

5.7.8 Indexing: GATE CSE 2013 | Question: 15

An index is clustered, if

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

gatecse-2013 databases indexing normal

Answer key☟

5.7.9 Indexing: GATE CSE 2015 Set 1 | Question: 24

A file is organized so that the ordering of the data records is the same as or close to the ordering of data
entries in some index. Then that index is called

A. Dense B. Sparse C. Clustered D. Unclustered


gatecse-2015-set1 databases indexing easy

Answer key☟

5.7.10 Indexing: GATE CSE 2020 | Question: 54

Consider a database implemented using tree for file indexing and installed on a disk drive with block
size of . The size of search key is and the size of tree/disk pointer is . Assume that
the database has one million records. Also assume that no node of the tree and no records are present initially
in main memory. Consider that each record fits into one disk block. The minimum number of disk accesses required
to retrieve any record in the database is _______

gatecse-2020 numerical-answers databases b-tree indexing 2-marks

Answer key☟

5.7.11 Indexing: GATE CSE 2021 Set 2 | Question: 21

A data file consisting of student-records is stored on a hard disk with block size of bytes.
The data file is sorted on the primary key . The size of a record pointer for this disk is bytes. Each
student-record has a candidate key attribute called of size bytes. Suppose an index file with records
consisting of two fields, value and the record pointer the corresponding student record, is built and stored
on the same disk. Assume that the records of data file and index file are not split across disk blocks. The number of
blocks in the index file is ________

gatecse-2021-set2 numerical-answers databases indexing 1-mark

Answer key☟

5.7.12 Indexing: GATE CSE 2023 | Question: 52

Consider a database of fixed-length records, stored as an ordered file. The database has records,
with each record being bytes, of which the primary key occupies bytes. The data file is block-aligned
in that each data record is fully contained within a block. The database is indexed by a primary index file, which is
also stored as a block-aligned ordered file. The figure below depicts this indexing scheme.
Suppose the block size of the file system is bytes, and a pointer to a block occupies bytes. The system
uses binary search on the index file to search for a record with a given key. You may assume that a binary search
on an index file of blocks takes block accesses in the worst case.
Given a key, the number of block accesses required to identify the block in the data file that may contain a record
with the key, in the worst case, is _____________.

gatecse-2023 databases file-system indexing numerical-answers 2-marks

Answer key☟

5.7.13 Indexing: GATE CSE 2024 | Set 2 | Question: 16

​Which of the following file organizations is/are efficient for the scan operation in ?

A. Sorted B. Heap
C. Unclustered tree index D. Unclustered hash index
gatecse2024-set2 databases multiple-selects indexing

Answer key☟

5.8 Joins (7)

5.8.1 Joins: GATE CSE 2004 | Question: 14

Consider the following relation schema pertaining to a students database:

Students (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 and
respectively. What are the maximum and minimum number of tuples that can be present in (Student * Enroll),
where ‘*’ denotes natural join?

A. B. C. D.
gatecse-2004 databases easy joins natural-join

Answer key☟

5.8.2 Joins: GATE CSE 2012 | Question: 50

Consider the following relations and


How many tuples does the result of the following relational algebra expression contain? Assume that the schema of
is the same as that of .

A. B. C. D.
gatecse-2012 databases joins normal

Answer key☟

5.8.3 Joins: GATE CSE 2014 Set 2 | Question: 30

Consider a join (relation algebra) between relations and using the nested loop method. There are
buffers each of size equal to disk block size, out of which one buffer is reserved for intermediate results.
Assuming the join will have fewer number of disk block accesses if

A. relation is in the outer loop.


B. relation is in the outer loop.
C. join selection factor between and is more than .
D. join selection factor between and is less than .

gatecse-2014-set2 databases normal joins

Answer key☟

5.8.4 Joins: GATE IT 2005 | Question: 82a

A database table has records and occupies disk blocks. Another table has records and
occupies 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 and one block of records for 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

A. B. C. D.
gateit-2005 databases normal joins

Answer key☟

5.8.5 Joins: GATE IT 2005 | Question: 82b

A database table has records and occupies disk blocks. Another table has records and
occupies 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 and one block of records for 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

A. B. C. D.
gateit-2005 databases normal joins

Answer key☟
5.8.6 Joins: GATE IT 2006 | Question: 14

Consider the relations and with primary keys and respectively. The relation
contains tuples and contains tuples. The maximum size of the join is :

A. B. C. D.
gateit-2006 databases joins natural-join normal

Answer key☟

5.8.7 Joins: GATE IT 2007 | Question: 68

Consider the following relation schemas :

b-Schema = (b-name, b-city, assets)


a-Schema = (a-num, b-name, bal)
d-Schema = (c-name, a-number)

Let branch, account and depositor be respectively instances of the above schemas. Assume that account and
depositor relations are much bigger than the branch relation.
Consider the following query:
Пc-name (σb-city = "Agra" ⋀ bal < 0 (branch ⋈ (account ⋈ depositor)
Which one of the following queries is the most efficient version of the above query ?

A. Пc-name (σbal < 0 (σb-city = "Agra" branch ⋈ account) ⋈ depositor)


B. Пc-name (σb-city = "Agra" branch ⋈ (σbal < 0 account ⋈ depositor))
C. Пc-name ((σb-city = "Agra" branch ⋈ σb-city = "Agra" ⋀ bal < 0 account) ⋈ depositor)
D. Пc-name (σb-city = "Agra" branch ⋈ (σb-city = "Agra" ⋀ bal < 0 account ⋈ depositor))

gateit-2007 databases joins relational-algebra normal

Answer key☟

5.9 Multivalued Dependency 4nf (1)

5.9.1 Multivalued Dependency 4nf: GATE IT 2007 | Question: 67

Consider the following implications relating to functional and multivalued dependencies given below, which
may or may not be correct.

i. if and then
ii. if and then
iii. if and then
iv. if and then

Exactly how many of the above implications are valid?

A. B. C. D.
gateit-2007 databases database-normalization multivalued-dependency-4nf normal

Answer key☟

5.10 Natural Join (3)

5.10.1 Natural Join: GATE CSE 2005 | Question: 30

Let r be a relation instance with schema R = (A, B, C, D). We define and . Let
where denotes natural join. Given that the decomposition of into and is lossy, which
one of the following is TRUE?

A. B. C. D.

gatecse-2005 databases relational-algebra natural-join normal


Answer key☟

5.10.2 Natural Join: GATE CSE 2010 | Question: 43

The following functional dependencies hold for relations and

The relation contains tuples and the relation contains tuples. What is the maximum number of tuples
possible in the natural join ?

A. B. C. D.
gatecse-2010 databases normal natural-join database-normalization

Answer key☟

5.10.3 Natural Join: GATE CSE 2015 Set 2 | Question: 32

Consider two relations with the tuples and .


Assume that is the full natural outer join of and . Consider the following tuples of the form

Which one of the following statements is correct?

A. contains but not . B. contains all .


C. contains but not . D. contains but not .
gatecse-2015-set2 databases normal natural-join

Answer key☟

5.11 Query (1)

5.11.1 Query: GATE CSE 1997 | Question: 76-b

Consider the following relational database schema:

EMP (eno name, age)


PROJ (pno name)
INVOLVED (eno, pno)

EMP contains information about employees. PROJ about projects and involved about which employees involved in
which projects. The underlined attributes are the primary keys for the respective relations.
State in English (in not more than 15 words)
What the following relational algebra expressions are designed to determine

i.
ii.

(Note: conceptually makes a copy of and names it ( is called the rename operator))

gate1997 databases sql descriptive normal relational-algebra query

Answer key☟

5.12 Referential Integrity (5)

5.12.1 Referential Integrity: GATE CSE 1997 | Question: 6.10, ISRO2016-54

Let and be two relations in which is the foreign key of that refers to the primary key
of . Consider the following four operations and
I. Insert into
II. Insert into
III. Delete from
IV. Delete from

Which of the following can cause violation of the referential integrity constraint above?

A. Both I and IV B. Both II and III C. All of these D. None of these

gate1997 databases referential-integrity easy isro2016

Answer key☟

5.12.2 Referential Integrity: GATE CSE 2005 | Question: 76

The following table has two attributes and where is the primary key and is the foreign key
referencing with on-delete cascade.

The set of all tuples that must be additionally deleted to preserve referential integrity when the tuple is
deleted is:

A. and B. and
C. and D. and
gatecse-2005 databases referential-integrity normal

Answer key☟

5.12.3 Referential Integrity: GATE CSE 2012 | Question: 43

Suppose and are two relation schemas. Let and be the corresponding relation
instances. is a foreign key that refers to in . If data in and satisfy referential integrity
constraints, which of the following is ALWAYS TRUE?

A.
B.
C.
D.

gatecse-2012 databases relational-algebra normal referential-integrity

Answer key☟

5.12.4 Referential Integrity: GATE CSE 2017 Set 2 | Question: 19

Consider the following tables and


In table P is the primary key and Q is the foreign key referencing R in table with on-delete cascade and on-
update cascade. In table R is the primary key and S is the foreign key referencing P in table with on-delete
set NULL and on-update cascade. In order to delete record from the table the number of additional
records that need to be deleted from table is _______

gatecse-2017-set2 databases numerical-answers referential-integrity normal

Answer key☟

5.12.5 Referential Integrity: GATE CSE 2021 Set 2 | Question: 6

Consider the following statements and about the relational data model:

: A relation scheme can have at most one foreign key.


: A foreign key in a relation scheme cannot be used to refer to tuples of

Which one of the following choices is correct?

A. Both and are true B. is true and is false


C. is false and is true D. Both and are false
gatecse-2021-set2 databases referential-integrity 1-mark

Answer key☟

5.13 Relational Algebra (29)

5.13.1 Relational Algebra: GATE CSE 1992 | Question: 13b

Suppose we have a database consisting of the following three relations:

The first indicates the hotels each customer visits, the second tells which snacks each hotel serves and last
indicates which snacks are liked by each customer. Express the following query in relational algebra:

Print the hotels the serve the snack that customer Rama likes.

gate1992 databases relational-algebra normal descriptive

Answer key☟

5.13.2 Relational Algebra: GATE CSE 1994 | Question: 13

Consider the following relational schema:

COURSES (cno, cname)


STUDENTS (rollno, sname, age, year)
REGISTERED_FOR (cno, rollno)
The underlined attributes indicate the primary keys for the relations. The ‘year’ attribute for the STUDENTS relation
indicates the year in which the student is currently studying (First year, Second year etc.)

A. Write a relational algebra query to print the roll number of students who have registered for cno
B. Write a SQL query to print the age and year of the youngest student in each year.

gate1994 databases relational-algebra sql normal descriptive

Answer key☟

5.13.3 Relational Algebra: GATE CSE 1994 | Question: 3.8

Give a relational algebra expression using only the minimum number of operators from which is
equivalent to

gate1994 databases relational-algebra normal descriptive

Answer key☟

5.13.4 Relational Algebra: GATE CSE 1995 | Question: 27

Consider the relation scheme.

Express the following queries using (one or more of) SELECT, PROJECT, JOIN and DIVIDE operations.

A. Get the names of all publishers.


B. Get values of all attributes of all authors who have published a book for the publisher with
PNAME=’TECHNICAL PUBLISHERS’.
C. Get the names of all authors who have published a book for any publisher located in Madras

gate1995 databases relational-algebra normal descriptive

Answer key☟

5.13.5 Relational Algebra: GATE CSE 1996 | Question: 27

A library relational database system uses the following schema

USERS (User#, User Name, Home Town)


BOOKS (Book#, Book Title, Author Name)
ISSUED (Book#, User#, Date)

Explain in one English sentence, what each of the following relational algebra queries is designed to determine

a.
b.

gate1996 databases relational-algebra descriptive

Answer key☟

5.13.6 Relational Algebra: GATE CSE 1997 | Question: 76-a

Consider the following relational database schema:

EMP (eno name, age)


PROJ (pno name)
INVOLVED (eno, pno)

EMP contains information about employees. PROJ about projects and involved about which employees involved in
which projects. The underlined attributes are the primary keys for the respective relations.
What is the relational algebra expression containing one or more of which is equivalent to SQL
query.
select eno from EMP|INVOLVED where EMP.eno=INVOLVED.eno and INVOLVED.pno=3

gate1997 databases sql relational-algebra descriptive

Answer key☟

5.13.7 Relational Algebra: GATE CSE 1998 | Question: 1.33

Given two union compatible relations and , what is the result of the operation
?

A. B. C. D.

gate1998 normal relational-algebra

Answer key☟

5.13.8 Relational Algebra: GATE CSE 1998 | Question: 27

Consider the following relational database schemes:

COURSES (Cno, Name)


PRE_REQ(Cno, Pre_Cno)
COMPLETED (Student_no, Cno)

COURSES gives the number and name of all the available courses.
PRE_REQ gives the information about which courses are pre-requisites for a given course.
COMPLETED indicates what courses have been completed by students
Express the following using relational algebra:
List all the courses for which a student with Student_no 2310 has completed all the pre-requisites.

gate1998 databases relational-algebra normal descriptive

Answer key☟

5.13.9 Relational Algebra: GATE CSE 1999 | Question: 1.18, ISRO2016-53

Consider the join of a relation with a relation . If has tuples and has tuples then the maximum
and minimum sizes of the join respectively are

A. and
B. and
C. and
D. and

gate1999 databases relational-algebra easy isro2016

Answer key☟

5.13.10 Relational Algebra: GATE CSE 2000 | Question: 1.23, ISRO2016-57

Given the relations

employee (name, salary, dept-no), and


department (dept-no, dept-name,address),

Which of the following queries cannot be expressed using the basic relational algebra operations
?

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

gatecse-2000 databases relational-algebra easy isro2016

Answer key☟

5.13.11 Relational Algebra: GATE CSE 2001 | Question: 1.24

Suppose the adjacency relation of vertices in a graph is represented in a table Adj Which of the
following queries cannot be expressed by a relational algebra expression of constant length?

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

gatecse-2001 databases relational-algebra normal

Answer key☟

5.13.12 Relational Algebra: GATE CSE 2001 | Question: 1.25

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

A. B.
C. D. None of the above
gatecse-2001 databases relational-algebra

Answer key☟

5.13.13 Relational Algebra: GATE CSE 2002 | Question: 15

A university placement center maintains a relational database of companies that interview students on
campus and make job offers to those successful in the interview. The schema of the database is given
below:

The COMPANY relation gives the name and location of the company. The STUDENT relation gives the student’s
roll number, name and the degree program for which the student is registered in the university. The INTERVIEW
relation gives the date on which a student is interviewed by a company. The OFFER relation gives the salary
offered to a student who is successful in a company’s interview. The key for each relation is indicated by the
underlined attributes

a. Write a relational algebra expressions (using only the operators ) for the following queries.
i. List the and of students who attended at least one interview but did not receive
job offer.
ii. List the and of students who went for interviews and received job offers from
company with which they interviewed.
b. Write an SQL query to list, for each degree program in which more than students were offered jobs, the
name of the degree and the average offered salary of students in this degree program.

gatecse-2002 databases normal descriptive relational-algebra sql

Answer key☟

5.13.14 Relational Algebra: GATE CSE 2003 | Question: 30

Consider the following SQL query


Select distinct
from
where P
For an arbitrary predicate P, this query is equivalent to which of the following relational algebra expressions?

A.
B.
C.
D.

gatecse-2003 databases relational-algebra normal

Answer key☟

5.13.15 Relational Algebra: GATE CSE 2004 | Question: 51

Consider the relation Student (name, sex, marks), where the primary key is shown underlined, pertaining to
students in a class that has at least one boy and one girl. What does the following relational algebra
expression produce? (Note: is the rename operator).

A. names of girl students with the highest marks


B. names of girl students with more marks than some boy student
C. names of girl students with marks not less than some boy student
D. names of girl students with more marks than all the boy students

gatecse-2004 databases relational-algebra normal

Answer key☟

5.13.16 Relational Algebra: GATE CSE 2007 | Question: 59

Information about a collection of students is given by the relation . The


relation gives which student has enrolled for (or taken) what course(s). Assume
that every course is taken by at least one male and at least one female student. What does the following relational
algebra expression represent?

A. Courses in which all the female students are enrolled.


B. Courses in which a proper subset of female students are enrolled.
C. Courses in which only male students are enrolled.
D. None of the above

gatecse-2007 databases relational-algebra normal

Answer key☟

5.13.17 Relational Algebra: GATE CSE 2008 | Question: 68

Let R and S be two relations with the following schema

where is the key for both schemas. Which of the following queries are equivalent?

I.
II.
III.
IV.
A. Only I and II B. Only I and III C. Only I, II and III D. Only I, III and IV
gatecse-2008 databases relational-algebra normal

Answer key☟

5.13.18 Relational Algebra: GATE CSE 2014 Set 3 | Question: 21

What is the optimized version of the relation algebra expression , where


are sets of attributes in with and are Boolean expressions based on the attributes in ?

A. B.
C. D.
gatecse-2014-set3 databases relational-algebra easy

Answer key☟

5.13.19 Relational Algebra: GATE CSE 2014 Set 3 | Question: 30

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

A. some dependent. B. all dependents.


C. some of his/her dependents. D. all of his/her dependents.
gatecse-2014-set3 databases relational-algebra normal

Answer key☟

5.13.20 Relational Algebra: GATE CSE 2015 Set 1 | Question: 7

SELECT operation in SQL is equivalent to

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

gatecse-2015-set1 databases sql relational-algebra easy

Answer key☟

5.13.21 Relational Algebra: GATE CSE 2017 Set 1 | Question: 46

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.

The number of rows in is ______________ .

gatecse-2017-set1 databases relational-algebra normal numerical-answers

Answer key☟

5.13.22 Relational Algebra: GATE CSE 2018 | Question: 41

Consider the relations and , where is a primary key and is a foreign key
referencing . Consider the query

Let LOJ denote the natural left outer-join operation. Assume that and contain no null values.
Which of the following is NOT equivalent to ?

A. B.
C. D.
gatecse-2018 databases relational-algebra normal 2-marks

Answer key☟

5.13.23 Relational Algebra: GATE CSE 2019 | Question: 55

Consider the following relations and .


How many tuples will be returned by the following relational algebra query?

Answer: ________

gatecse-2019 numerical-answers databases relational-algebra 2-marks

Answer key☟

5.13.24 Relational Algebra: GATE CSE 2021 Set 1 | Question: 27

The following relation records the age of employees of a company, where (indicating the
employee number) is the key:

Consider the following relational algebra expression:

What does the above expression generate?

A. Employee numbers of only those employees whose age is the maximum


B. Employee numbers of only those employees whose age is more than the age of exactly one other employee
C. Employee numbers of all employees whose age is not the minimum
D. Employee numbers of all employees whose age is the minimum

gatecse-2021-set1 databases relational-algebra 2-marks

Answer key☟

5.13.25 Relational Algebra: GATE CSE 2022 | Question: 15

Consider the following three relations in a relational database.

Which of the following relational algebra expressions return the set of who own all the brands?

A.
B.
C.
D.

gatecse-2022 databases relational-algebra multiple-selects 1-mark

Answer key☟

5.13.26 Relational Algebra: GATE CSE 2024 | Set 1 | Question: 25

Consider the following two relations, and :


The total number of tuples obtained by evaluating the following expression
is ___________.

gatecse2024-set1 numerical-answers databases relational-algebra

Answer key☟

5.13.27 Relational Algebra: GATE CSE 2024 | Set 2 | Question: 35

The relation schema, Person (pid, city), describes the city of residence for every person uniquely identified
by pid. The following relational algebra operators are available: selection, projection, cross product, and
rename.
To find the list of cities where at least persons reside, using the above operators, the minimum number of cross
product operations that must be used is

A. B. C. D.
gatecse2024-set2 databases relational-algebra

Answer key☟

5.13.28 Relational Algebra: GATE DS&AI 2024 | Question: 16

​Consider a database that includes the following relations:


Defender(name, rating, side, goals)
Forward(name, rating, assists, goals)
Team(name, club, price)
Which ONE of the following relational algebra expressions checks that every name occurring in Team appears in
either Defender or Forward, where denotes the empty set?

A. Team Defender Forward


B. Defender Forward Team
C. Team Defender Forward
D. Defender Forward Team

gate-ds-ai-2024 relational-algebra databases

Answer key☟

5.13.29 Relational Algebra: GATE IT 2005 | Question: 68

A table 'student' with schema (roll, name, hostel, marks), and another table 'hobby' with schema (roll,
hobbyname) contains records as shown below:
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 and with the same schema as those of these two tables respectively contain the same information
as tuples. A new relation is obtained by the following relational algebra operation:

The difference between the number of rows output by the SQL statement and the number of tuples in is

A. B. C. D.
gateit-2005 databases sql relational-algebra normal

Answer key☟

5.14 Relational Calculus (15)

5.14.1 Relational Calculus: GATE CSE 1993 | Question: 23

The following relations are used to store data about students, courses, enrollment of students in courses and
teachers of courses. Attributes for primary key in each relation are marked by ‘*’.
Students (rollno*, sname, saddr)
courses (cno*, cname)
enroll(rollno*, cno*, grade)
teach(tno*, tname, cao*)

(cno is course number cname is course name, tno is teacher number, tname is teacher name, sname is student
name, etc.)
Write a SQL query for retrieving roll number and name of students who got A grade in at least one course taught by
teacher names Ramesh for the above relational database.

gate1993 databases sql relational-calculus normal descriptive

Answer key☟

5.14.2 Relational Calculus: GATE CSE 1993 | Question: 24

The following relations are used to store data about students, courses, enrollment of students in courses and
teachers of courses. Attributes for primary key in each relation are marked by

is course number, is course name, is teacher number, is teacher name, is student


name, etc.)
For the relational database given above, the following functional dependencies hold:

a. Is the database in normal form ?


b. If yes, prove that it is in . If not, normalize the relations so that they are in (without proving).

gate1993 databases sql relational-calculus normal descriptive

Answer key☟

5.14.3 Relational Calculus: GATE CSE 1998 | Question: 2.19

Which of the following query transformations (i.e., replacing the l.h.s. expression by the r.h.s expression) is
incorrect? R1 and R2 are relations, C1 and C2 are selection conditions and A1 and A2 are attributes of R1.

A.
B.
C.
D.

gate1998 databases relational-calculus normal

Answer key☟

5.14.4 Relational Calculus: GATE CSE 1999 | Question: 1.19

The relational algebra expression equivalent to the following tuple calculus expression:
is

A. B.
C. D.
gate1999 databases relational-calculus normal

Answer key☟

5.14.5 Relational Calculus: GATE CSE 2001 | Question: 2.24

Which of the following relational calculus expression is not safe?

A.
B.
C.
D.

gatecse-2001 relational-calculus normal databases

Answer key☟
5.14.6 Relational Calculus: GATE CSE 2002 | Question: 1.20

With regards to the expressive power of the formal relational query languages, which of the following
statements is true?

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

gatecse-2002 databases relational-calculus normal

Answer key☟

5.14.7 Relational Calculus: GATE CSE 2004 | Question: 13

Let and be two relation schema, where the primary keys are shown underlined,
and let C be a foreign key in referring to . Suppose there is no violation of the above referential
integrity constraint in the corresponding relation instances and . Which of the following relational algebra
expressions would necessarily produce an empty relation?

A. B.
C. D.
gatecse-2004 databases relational-calculus easy

Answer key☟

5.14.8 Relational Calculus: GATE CSE 2007 | Question: 60

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?

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.

gatecse-2007 databases relational-calculus normal

Answer key☟

5.14.9 Relational Calculus: GATE CSE 2008 | Question: 15

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

I.
II.
III.
IV.
A. I only B. II only C. III only D. III and IV only
gatecse-2008 databases relational-calculus normal

Answer key☟

5.14.10 Relational Calculus: GATE CSE 2009 | Question: 45

Let and be relational schemes such that and Now consider the following
queries on the database:

1.
2.
3.

4. Select R.a,R.b
From R,S
Where R.c = S.c

Which of the above queries are equivalent?

A. and B. and C. and D. and


gatecse-2009 databases relational-calculus difficult

Answer key☟

5.14.11 Relational Calculus: GATE CSE 2013 | Question: 35

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 in the course numbered 107”

I. SELECT DISTINCT S.sname FROM Students as S, Registration


as R WHERE
R.rollno=S.rollno AND R.courseno=107 AND R.percent >90

II.
III.

IV.

A. I, II, III and IV B. I, II and III only


C. I, II and IV only D. II, III and IV only
gatecse-2013 databases sql relational-calculus normal

Answer key☟

5.14.12 Relational Calculus: GATE CSE 2017 Set 1 | Question: 41

Consider a database that has the relation schemas EMP(EmpId, EmpName, DeptId), and DEPT(DeptName,
DeptId). Note that the DeptId can be permitted to be NULL in the relation EMP. Consider the following
queries on the database expressed in tuple relational calculus.

I. { | u EMP(t[EmpName] = u[EmpName] v DEPT(t[DeptId] v[DeptId]))}


II. { | u EMP(t[EmpName] = u[EmpName] v DEPT(t[DeptId] v[DeptId]))}
III. { | u EMP(t[EmpName] = u[EmpName] v DEPT(t[DeptId] v[DeptId]))}

Which of the above queries are safe?

A. I and II only B. I and III only C. II and III only D. I, II and III
gatecse-2017-set1 databases relational-calculus safe-query normal

Answer key☟

5.14.13 Relational Calculus: GATE IT 2006 | Question: 15

Which of the following relational query languages have the same expressive power?

I. Relational algebra
II. Tuple relational calculus restricted to safe expressions
III. Domain relational calculus restricted to safe expressions
A. II and III only B. I and II only C. I and III only D. I, II and III
gateit-2006 databases relational-algebra relational-calculus easy

Answer key☟

5.14.14 Relational Calculus: GATE IT 2007 | Question: 65

Consider a selection of the form , where is a relation with tuples. Assume that the attribute
values for among the tuples are uniformly distributed in the interval Which one of the following
options is the best estimate of the number of tuples returned by the given selection query ?

A. B. C. D.
gateit-2007 databases relational-calculus probability normal

Answer key☟

5.14.15 Relational Calculus: GATE IT 2008 | Question: 75

Consider the following relational schema:

Consider the following tuple relational calculus query.

If a student needs to score more than 35 marks to pass an exam, what does the query return?

A. The empty set


B. schools with more than of its students enrolled in some exam or the other
C. schools with a pass percentage above over all exams taken together
D. schools with a pass percentage above over each exam

gateit-2008 databases relational-calculus normal

Answer key☟

5.15 Relational Model (1)

5.15.1 Relational Model: GATE CSE 2023 | Question: 6

Which one of the options given below refers to the degree (or arity) of a relation in relational database
systems?

A. Number of attributes of its relation schema.


B. Number of tuples stored in the relation.
C. Number of entries in the relation.
D. Number of distinct domains of its relation schema.

gatecse-2023 databases relational-model 1-mark easy

Answer key☟

5.16 SQL (55)

5.16.1 SQL: GATE CSE 1988 | Question: 12iii

Describe the relational algebraic expression giving the relation returned by the following SQL query.
Select SNAME
from S
Where SNOin
(select SNO
from SP
where PNOin
(select PNO
from P
Where COLOUR='BLUE'))

gate1988 normal descriptive databases sql

Answer key☟

5.16.2 SQL: GATE CSE 1988 | Question: 12iv

Select SNAME
from S
Where SNOin
(select SNO
from SP
where PNOin
(select PNO
from P
Where COLOUR='BLUE'))

What relations are being used in the above SQL query? Given at least two attributes of each of these relations.

gate1988 normal descriptive databases sql

Answer key☟

5.16.3 SQL: GATE CSE 1990 | Question: 10-a

Consider the following relational database:

employees (eno, ename, address, basic-salary)


projects (pno, pname, nos-of-staffs-allotted)
working (pno, eno, pjob)

The queries regarding data in the above database are formulated below in SQL. Describe in ENGLISH sentences
the two queries that have been posted:

i. SELECT ename
FROM employees
WHERE eno IN
(SELECT eno
FROM working
GROUP BY eno
HAVING COUNT(*)=
(SELECT COUNT(*)
FROM projects))

ii. SELECT pname


FROM projects
WHERE pno IN
(SELECT pno
FROM projects
MINUS
SELECT DISTINCT pno
FROM working);

gate1990 descriptive databases sql

Answer key☟

5.16.4 SQL: GATE CSE 1991 | Question: 12,b

Suppose a database consist of the following relations:


SUPPLIER (SCODE,SNAME,CITY).

PART (PCODE,PNAME,PDESC,CITY).

PROJECTS (PRCODE,PRNAME,PRCITY).
SPPR (SCODE,PCODE,PRCODE,QTY).

Write algebraic solution to the following :

i. Get SCODE values for suppliers who supply to both projects PR1 and PR2.
ii. Get PRCODE values for projects supplied by at least one supplier not in the same city.

sql gate1991 normal databases descriptive

Answer key☟

5.16.5 SQL: GATE CSE 1991 | Question: 12-a

Suppose a database consist of the following relations:


SUPPLIER (SCODE,SNAME,CITY).
PART (PCODE,PNAME,PDESC,CITY).
PROJECTS (PRCODE,PRNAME,PRCITY).
SPPR (SCODE,PCODE,PRCODE,QTY).

Write SQL programs corresponding to the following queries:

i. Print PCODE values for parts supplied to any project in DEHLI by a supplier in DELHI.
ii. Print all triples <CITY, PCODE, CITY> such that a supplier in first city supplies the specified part to a project in
the second city, but do not print the triples in which the two CITY values are same.

gate1991 databases sql normal descriptive

Answer key☟

5.16.6 SQL: GATE CSE 1998 | Question: 7-a

Suppose we have a database consisting of the following three relations.

giving the parlors each student visits.


indicating what kind of ice-creams each parlor serves.
indicating what ice-creams each student likes.

(Assume that each student likes at least one ice-cream and frequents at least one parlor)
Express the following in SQL:
Print the students that frequent at least one parlor that serves some ice-cream that they like.

gate1998 databases sql descriptive

Answer key☟

5.16.7 SQL: GATE CSE 1999 | Question: 2.25

Which of the following is/are correct?

A. An SQL query automatically eliminates duplicates


B. An SQL query will not work if there are no indexes on the relations
C. SQL permits attribute names to be repeated in the same relation
D. None of the above

gate1999 databases sql easy

Answer key☟

5.16.8 SQL: GATE CSE 1999 | Question: 22-a

Consider the set of relations

EMP (Employee-no. Dept-no, Employee-name, Salary)


DEPT (Dept-no. Dept-name, Location)

Write an SQL query to:


a. Find all employees names who work in departments located at ‘Calcutta’ and whose salary is greater than
Rs.50,000.
b. Calculate, for each department number, the number of employees with a salary greater than Rs. 1,00,000.

gate1999 databases sql easy descriptive

Answer key☟

5.16.9 SQL: GATE CSE 1999 | Question: 22-b

Consider the set of relations

EMP (Employee-no. Dept-no, Employee-name, Salary)


DEPT (Dept-no. Dept-name, Location)

Write an SQL query to:


Calculate, for each department number, the number of employees with a salary greater than Rs. 1,00,000

gate1999 databases sql descriptive easy

Answer key☟

5.16.10 SQL: GATE CSE 2000 | Question: 2.25

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.

A. r has no duplicates and s is non- B. r and s have no duplicates


empty
C. s has no duplicates and r is non- D. r and s have the same number of
empty tuples
gatecse-2000 databases sql

Answer key☟

5.16.11 SQL: GATE CSE 2000 | Question: 2.26

In SQL, relations can contain null values, and comparisons with null values are treated as unknown.
Suppose all comparisons with a null value are treated as false. Which of the following pairs is not
equivalent?

A.
B. and where is an integer
C.
D. none of the above

gatecse-2000 databases sql normal

Answer key☟

5.16.12 SQL: GATE CSE 2000 | Question: 22

Consider a bank database with only one relation


transaction (transno, acctno, date, amount)
The amount attribute value is positive for deposits and negative for withdrawals.

a. Define an SQL view TP containing the information


(acctno,T1.date,T2.amount)
for every pair of transaction T1,T2 and such that T1 and T2 are transaction on the same account and the date
of T2 is the date of T1.
b. Using only the above view TP, write a query to find for each account the minimum balance it ever reached (not
including the 0 balance when the account is created). Assume there is at most one transaction per day on
each account and each account has at least one transaction since it was created. To simplify your query, break
it up into 2 steps by defining an intermediate view V.

gatecse-2000 databases sql normal descriptive

Answer key☟

5.16.13 SQL: GATE CSE 2001 | Question: 2.25

Consider a relation geq which represents "greater than or equal to", that is, geq only if .
create table geq
(
ib integer not null,
ub integer not null,
primary key ib,
foreign key (ub) references geq on delete cascade
);

Which of the following is possible if tuple (x,y) is deleted?

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
gatecse-2001 databases sql normal

Answer key☟

5.16.14 SQL: GATE CSE 2001 | Question: 21-a

Consider a relation examinee (regno, name, score), where regno is the primary key to score is a real
number.

Write a relational algebra using to find the list of names which appear more than once in examinee.

gatecse-2001 databases sql normal descriptive

Answer key☟

5.16.15 SQL: GATE CSE 2001 | Question: 21-b

Consider a relation examinee (regno, name, score), where regno is the primary key to score is a real
number.
Write an SQL query to list the regno of examinees who have a score greater than the average score.

gatecse-2001 databases sql normal descriptive

Answer key☟

5.16.16 SQL: GATE CSE 2001 | Question: 21-c

Consider a relation where regno is the primary key to score is a real


number.
Suppose the relation specifies the center where an examinee appears. Write an
SQL query to list the centr_code having an examinee of score greater than

gatecse-2001 databases sql normal descriptive

Answer key☟

5.16.17 SQL: GATE CSE 2003 | Question: 86

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'

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

gatecse-2003 databases sql easy

Answer key☟

5.16.18 SQL: GATE CSE 2004 | Question: 53

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

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 same the department
D. the average salary of male employees is more than the average salary in the company

gatecse-2004 databases sql normal

Answer key☟

5.16.19 SQL: GATE CSE 2005 | Question: 77, ISRO2016-55

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

A. Titles of the four most expensive books


B. Title of the fifth most inexpensive book
C. Title of the fifth most expensive book
D. Titles of the five most expensive books

gatecse-2005 databases sql easy isro2016

Answer key☟

5.16.20 SQL: GATE CSE 2006 | Question: 67

Consider the relation account (customer, balance) where the 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 Ties are not broke but ranks are skipped: if exactly two customers have the largest balance
they each get rank and rank is not assigned.

select A.customer, count(B.customer)


from account A, account B
where A.balance <=B.balance
group by A.customer

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 Query and Query

1. Query will produce the same row set as Query for some but not all databases.
2. Both Query and Query are a correct implementation of the specification
3. Query is a correct implementation of the specification but Query is not
4. Neither Query nor Query 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?

A. and B. and C. and D. and


gatecse-2006 databases sql normal

Answer key☟

5.16.21 SQL: GATE CSE 2006 | Question: 68

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?

A. All queries return identical row sets for any database


B. Query and Query return identical row sets for all databases but there exist databases for which Query and
Query return different row sets
C. There exist databases for which Query returns strictly fewer rows than Query
D. There exist databases for which Query will encounter an integrity violation at runtime

gatecse-2006 databases sql normal

Answer key☟
5.16.22 SQL: GATE CSE 2006 | Question: 69

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. Assume that amounts and were each paid by of the
students. Consider these query plans (Plan 1 on left, Plan 2 on right) to “list all courses taken by students who have
paid more than x”

A disk seek takes disk data transfer bandwidth is MB/s and checking a tuple to see if amount is greater
than takes µ Which of the following statements is correct?

A. Plan 1 and Plan 2 will not output identical row sets for all databases
B. A course may be listed more than once in the output of Plan 1 for some databases
C. For Plan 1 executes faster than Plan 2 for all databases
D. For Plan I executes slower than Plan 2 for all databases

gatecse-2006 databases sql normal

Answer key☟

5.16.23 SQL: GATE CSE 2007 | Question: 61

Consider the table employee(empId, name, department, salary) and the two queries below.
Assuming that department has more than one employee, and we want to find the employees who get
higher salary than anyone in the department which one of the statements is TRUE for any arbitrary employee
table?

Select e.empId
From employee e
Where not exists
(Select * From employee s Where s.department = "5" and s.salary >= e.salary)

Select e.empId
From employee e
Where e.salary > Any
(Select distinct salary From employee s Where s.department = "5")

A. is the correct query B. is the correct query


C. B o t h and produce the D. Neither nor is the correct
same answer query
gatecse-2007 databases sql normal verbal-aptitude

Answer key☟

5.16.24 SQL: GATE CSE 2009 | Question: 55

Consider the following relational schema:


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?

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 non-blue part.
D. Find the names of all suppliers who have not supplied only blue parts.

gatecse-2009 databases sql normal

Answer key☟

5.16.25 SQL: GATE CSE 2009 | Question: 56

Consider the following relational schema:

Assume that, in the suppliers relation above, each supplier and each street within a city has 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 about the above schema?

A. The schema is in B. The schema is in but not in

C. The schema is in but not in D. The schema is not in

gatecse-2009 databases sql database-normalization normal

Answer key☟

5.16.26 SQL: GATE CSE 2010 | Question: 19

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

passenger(pid, pname, age)


reservation(pid, class, tid)
What pids are returned by the following SQL query for the above instance of the tables?
SELECT pid
FROM Reservation
WHERE class='AC' AND
EXISTS (SELECT *
FROM Passenger
WHERE age>65 AND
Passenger.pid=Reservation.pid)

A. B. C. D.
gatecse-2010 databases sql normal

Answer key☟

5.16.27 SQL: GATE CSE 2011 | Question: 32

Consider a database table T containing two columns and each of type . After the creation of the
table, one record is inserted in the table.
Let and denote the respective maximum values of and among all records in the table at any point in
time. Using and , new records are inserted in the table times with and values being
respectively. It may be noted that each time after the insertion, values of and
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;

A. B. C. D.
gatecse-2011 databases sql normal

Answer key☟

5.16.28 SQL: GATE CSE 2011 | Question: 46

Database table by name is given below.

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
);
A. B. C. D.
gatecse-2011 databases sql normal

Answer key☟

5.16.29 SQL: GATE CSE 2012 | Question: 15

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

A. P and R B. P and S C. Q and R D. Q and S


gatecse-2012 databases easy sql ambiguous

Answer key☟

5.16.30 SQL: GATE CSE 2012 | Question: 51

Consider the following relations and

How many tuples does the result of the following SQL query contain?
SELECT A.Id
FROM A
WHERE A.Age > ALL (SELECT B.Age
FROM B
WHERE B.Name = ‘Arun’)

A. B. C. D.
gatecse-2012 databases sql normal

Answer key☟

5.16.31 SQL: GATE CSE 2014 Set 1 | Question: 22

Given the following statements:


S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL.
S2: Given the table where and 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?

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
gatecse-2014-set1 databases normal sql

Answer key☟
5.16.32 SQL: GATE CSE 2014 Set 1 | Question: 54

Given the following schema:


employees(emp-id, first-name, last-name, hire-date, dept-id, salary)
departments(dept-id, dept-name, manager-id, location-id)
You want to display the last names and hire dates of all latest hires in their respective departments in the location
You issue the following query:
SQL>SELECT last-name, hire-date
FROM employees
WHERE (dept-id, hire-date) IN
(SELECT dept-id, MAX(hire-date)
FROM employees JOIN departments USING(dept-id)
WHERE location-id =1700
GROUP BY dept-id);

What is the outcome?

A. It executes but does not give the correct result


B. It executes and gives the correct result.
C. It generates an error because of pairwise comparison.
D. It generates an error because of the GROUP BY clause cannot be used with table joins in a sub-query.

gatecse-2014-set1 databases sql normal

Answer key☟

5.16.33 SQL: GATE CSE 2014 Set 2 | Question: 54

SQL allows duplicate 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)

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

gatecse-2014-set2 databases sql normal

Answer key☟

5.16.34 SQL: GATE CSE 2014 Set 3 | Question: 54

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');

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.

gatecse-2014-set3 databases sql easy

Answer key☟
5.16.35 SQL: GATE CSE 2015 Set 1 | Question: 27

Consider the following relation:

Consider the following SQL query.


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 numbers of rows that will be returned by the SQL query is_________________.

gatecse-2015-set1 databases sql normal numerical-answers

Answer key☟

5.16.36 SQL: GATE CSE 2015 Set 3 | Question: 3

Consider the following relation


Cinema( )
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?

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)

gatecse-2015-set3 databases sql normal

Answer key☟

5.16.37 SQL: GATE CSE 2016 Set 2 | Question: 52

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

gatecse-2016-set2 databases sql normal numerical-answers

Answer key☟

5.16.38 SQL: GATE CSE 2017 Set 1 | Question: 23

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:

SELECT AVG(EC.Num)
FROM EC
WHERE (DeptName, Num) IN
(SELECT DeptName, COUNT(EmpId) AS
EC(DeptName, Num)
FROM EMP
GROUP BY DeptName)

The output of executing the SQL query is _____________ .

gatecse-2017-set1 databases sql numerical-answers

Answer key☟
5.16.39 SQL: GATE CSE 2017 Set 2 | Question: 46

Consider the following database table named .

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 ______

gatecse-2017-set2 databases sql numerical-answers

Answer key☟

5.16.40 SQL: GATE CSE 2018 | Question: 12

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 Book 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 Book 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?

A. Query 1 B. Query 2 C. Query 3 D. Query 4


gatecse-2018 databases sql easy 1-mark
Answer key☟

5.16.41 SQL: GATE CSE 2019 | Question: 51

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 form 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 ________

gatecse-2019 numerical-answers databases sql 2-marks

Answer key☟

5.16.42 SQL: GATE CSE 2020 | Question: 13

Consider a relational database containing the following schemas.

The primary key of each table is indicated by underlining the constituent fields.
SELECT s.sno, s.sname
FROM Suppliers s, Catalogue c
WHERE s.sno=c.sno AND
cost > (SELECT AVG (cost)
FROM Catalogue
WHERE pno = ‘P4’
GROUP BY pno) ;

The number of rows returned by the above SQL query is

A. B. C. D.
gatecse-2020 databases sql 1-mark

Answer key☟
5.16.43 SQL: GATE CSE 2021 Set 1 | Question: 23

A relation in a relational database has tuples. The attribute has integer values ranging from
to , and the attribute has integer values ranging from to . Assume that the attributes and are
independently distributed.

The estimated number of tuples in the output of is ____________.

gatecse-2021-set1 databases sql numerical-answers 1-mark

Answer key☟

5.16.44 SQL: GATE CSE 2021 Set 2 | Question: 31

The relation scheme given below is used to store information about the employees of a company, where
is the key and indicates the department to which the employee is assigned. Each employee is
assigned to exactly one department.

Consider the following query:


select deptId, count(*)
from emp
where gender = “female” and salary > (select avg(salary)from emp)
group by deptId;

The above query gives, for each department in the company, the number of female employees whose salary is
greater than the average salary of

A. employees in the department B. employees in the company


C. female employees in the D. female employees in the company
department
gatecse-2021-set2 databases sql easy 2-marks

Answer key☟

5.16.45 SQL: GATE CSE 2022 | Question: 46

Consider the relational database with the following four schemas and their respective instances.

Student(sNo, sName, dNo) Dept(dNo, dName)


Course(cNo, cName, dNo) Register(sNo, cNo)

SELECT * FROM Student AS S WHERE NOT EXIST

(SELECT cNo FROM Course WHERE dNo = “D01”


EXCEPT

SELECT cNo FROM Register WHERE sNo = S.sNo)

The number of rows returned by the above query is ____________.

gatecse-2022 numerical-answers databases sql 2-marks

Answer key☟

5.16.46 SQL: GATE CSE 2023 | Question: 51

Consider the following table named in a relational database. The primary key of this table is

The query below is executed on this database.


SELECT *
FROM Student
WHERE gender = 'F' AND
marks > 65;

The number of rows returned by the query is ___________.

gatecse-2023 databases sql numerical-answers 2-marks easy

Answer key☟

5.16.47 SQL: GATE DS&AI 2024 | Question: 21

Consider the following two tables named Raider and Team in a relational database maintained by a Kabaddi
league. The attribute ID in table Team references the primary key of the Raider table, ID.
Raider
ID Name Raids RaidPoints
Arjun
Ankush
Sunil
Reza
Pratham
Gopal

Team
City ID BidPoints
Jaipur
Patna
Hyderabad
Jaipur
Patna
Jaipur

The SQL query described below is executed on this database:


SELECT *
FROM Raider, Team
WHERE Raider.ID=Team.ID AND City="Jaipur" AND
RaidPoints > 200;

The number of rows returned by this query is .

gate-ds-ai-2024 numerical-answers databases sql

Answer key☟

5.16.48 SQL: GATE DS&AI 2024 | Question: 45

An OTT company is maintaining a large disk-based relational database of different movies with the following
schema:

Consider the following SQL query on the relation database above:


SELECT *
FROM Movie, Genre, Movie_Genre
WHERE
Movie.CustomerRating > 3.4 AND
Genre. Name = "Comedy" AND
Movie_Genre.MovieID = Movie. ID AND
Movie_Genre.GenreID = Genre. ;

This SQL query can be sped up using which of the following indexing options?

A. tree on all the attributes.


B. Hash index on Genre.Name and tree on the remaining attributes.
C. Hash index on Movie.CustomerRating and tree on the remaining attributes.
D. Hash index on all the attributes.

gate-ds-ai-2024 sql databases

Answer key☟

5.16.49 SQL: GATE IT 2004 | Question: 74

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

A. 0 row and 4 columns B. 3 rows and 4 columns


C. 3 rows and 5 columns D. 6 rows and 5 columns
gateit-2004 databases sql normal

Answer key☟

5.16.50 SQL: GATE IT 2004 | Question: 76

A table T1 in a relational database has the following rows and columns:


The following sequence of SQL statements was successfully executed on table T1.
Update T1 set marks = marks + 5
Select avg(marks) from T1

What is the output of the select statement?

A. B. C. D.
gateit-2004 databases sql normal

Answer key☟

5.16.51 SQL: GATE IT 2004 | Question: 78

Consider two tables in a relational database with columns and rows as follows:

Roll_no is the primary key of the Student table, Dept_id is the primary key of the Department table and
Student.Dept_id is a foreign key from Department.Dept_id
What will happen if we try to execute the following two SQL statements?

i. update Student set Dept_id = Null where Roll_on = 1


ii. update Department set Dept_id = Null where Dept_id = 1

A. Both i and ii will fail B. i will fail but ii will succeed


C. i will succeed but ii will fail D. Both i and ii will succeed
gateit-2004 databases sql normal

Answer key☟

5.16.52 SQL: GATE IT 2005 | Question: 69

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
A. do not supply any item B. supply exactly one item
C. supply one or more items D. supply two or more items
gateit-2005 databases sql normal

Answer key☟

5.16.53 SQL: GATE IT 2006 | Question: 84

Consider a database with three relation instances shown below. The primary keys for the Drivers and Cars
relation are did and cid respectively and the records are stored in ascending order of these primary keys as
given in the tables. No indexing is available in the database.

What is the output of the following SQL query?


select D.dname
from Drivers D
where D.did in (
select R.did
from Cars C, Reserves R
where R.cid = C.cid and C.colour = 'red'
intersect
select R.did
from Cars C, Reserves R
where R.cid = C.cid and C.colour = 'green'
)

A. Karthikeyan, Boris B. Sachin, Salman


C. Karthikeyan, Boris, Sachin D. Schumacher, Senna
gateit-2006 databases sql normal

Answer key☟

5.16.54 SQL: GATE IT 2006 | Question: 85

Consider a database with three relation instances shown below. The primary keys for the Drivers and Cars
relation are did and cid respectively and the records are stored in ascending order of these primary keys as given in
the tables. No indexing is available in the database.

select D.dname
from Drivers D
where D.did in (
select R.did
from Cars C, Reserves R
where R.cid = C.cid and C.colour = 'red'
intersect
select R.did
from Cars C, Reserves R
where R.cid = C.cid and C.colour = 'green'
)

Let be the number of comparisons performed when the above SQL query is optimally executed. If linear search is
used to locate a tuple in a relation using primary key, then lies in the range:

A. B. C. D.
gateit-2006 databases sql normal

Answer key☟

5.16.55 SQL: GATE IT 2008 | Question: 74

Consider the following relational schema:

What does the following SQL query output?


SELECT sch-name, COUNT (*)
FROM School C, Enrolment E, ExamResult R
WHERE E.school-id = C.school-id
AND
E.examname = R.examname AND E.erollno = R.erollno
AND
R.marks = 100 AND E.school-id IN (SELECT school-id
FROM student
GROUP BY school-id
HAVING COUNT (*) > 200)
GROUP By school-id

A. for each school with more than students appearing in exams, the name of the school and the number of
scored by its students
B. for each school with more than students in it, the name of the school and the number of scored by its
students
C. for each school with more than students in it, the name of the school and the number of its students scoring
in at least one exam
D. nothing; the query has a syntax error

gateit-2008 databases sql normal

Answer key☟

5.17 Transaction and Concurrency (28)

5.17.1 Transaction and Concurrency: GATE CSE 1999 | Question: 2.6

For the schedule given below, which of the following is correct:

A. This schedule is serializable and can occur in a scheme using 2PL protocol
B. This schedule is serializable but cannot occur in a scheme using 2PL protocol
C. This schedule is not serializable but can occur in a scheme using 2PL protocol
D. This schedule is not serializable and cannot occur in a scheme using 2PL protocol

gate1999 databases transaction-and-concurrency normal

Answer key☟

5.17.2 Transaction and Concurrency: GATE CSE 2003 | Question: 29, ISRO2009-73

Which of the following scenarios may lead to an irrecoverable error in a database system?

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

gatecse-2003 databases transaction-and-concurrency easy isro2009

Answer key☟

5.17.3 Transaction and Concurrency: GATE CSE 2003 | Question: 87

Consider three data items and and the following execution schedule of transactions
and In the diagram, and denote the actions reading and writing the data item
respectively.
Which of the following statements is correct?

A. The schedule is serializable as


B. The schedule is serializable as
C. The schedule is serializable as
D. The schedule is not serializable

gatecse-2003 databases transaction-and-concurrency normal

Answer key☟

5.17.4 Transaction and Concurrency: GATE CSE 2006 | Question: 20, ISRO2015-17

Consider the following log sequence of two transactions on a bank account, with initial balance that
transfer to a mortgage payment and then apply a interest.

1. T1 start
2. T1 B old new
3. T1 M old new
4. T1 commit
5. T2 start
6. T2 B old new
7. T2 commit

Suppose the database system crashes just before log record is written. When the system is restarted, which one
statement is true of the recovery procedure?

A. We must redo log record to set B to


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

gatecse-2006 databases transaction-and-concurrency normal isro2015

Answer key☟

5.17.5 Transaction and Concurrency: GATE CSE 2007 | Question: 64

Consider the following schedules involving two transactions. Which one of the following statements is
TRUE?
A. Both and are conflict serializable.
B. is conflict serializable and is not conflict serializable.
C. is not conflict serializable and is conflict serializable.
D. Both and are not conflict serializable.

gatecse-2007 databases transaction-and-concurrency normal

Answer key☟

5.17.6 Transaction and Concurrency: GATE CSE 2009 | Question: 43

Consider two transactions and , and four schedules , of and as given below:

Which of the above schedules are conflict-serializable?

A. B. C. only D. only
gatecse-2009 databases transaction-and-concurrency normal

Answer key☟

5.17.7 Transaction and Concurrency: GATE CSE 2010 | Question: 20

Which of the following concurrency control protocols ensure both conflict serializability and freedom from
deadlock?

I. -phase locking
II. Time-stamp ordering
A. I only B. II only C. Both I and II D. Neither I nor II
gatecse-2010 databases transaction-and-concurrency normal

Answer key☟

5.17.8 Transaction and Concurrency: GATE CSE 2010 | Question: 42

Consider the following schedule for transactions and

Which one of the schedules below is the correct serialization of the above?
A. B.
C. D.
gatecse-2010 databases transaction-and-concurrency normal

Answer key☟

5.17.9 Transaction and Concurrency: GATE CSE 2012 | Question: 27

Consider the following transactions with data items and initialized to zero:

Any non-serial interleaving of T1 and T2 for concurrent execution leads to

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

gatecse-2012 databases transaction-and-concurrency normal

Answer key☟

5.17.10 Transaction and Concurrency: GATE CSE 2015 Set 2 | Question: 1

Consider the following transaction involving two bank accounts and .


read(x); x:=x-50; write (x); read(y); y:=y+50; write(y)

The constraint that the sum of the accounts and should remain constant is that of

A. Atomicity B. Consistency C. Isolation D. Durability


gatecse-2015-set2 databases transaction-and-concurrency easy

Answer key☟

5.17.11 Transaction and Concurrency: GATE CSE 2015 Set 2 | Question: 46

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?

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
gatecse-2015-set2 databases transaction-and-concurrency normal

Answer key☟

5.17.12 Transaction and Concurrency: GATE CSE 2015 Set 3 | Question: 29

Consider the partial Schedule involving two transactions and . Only the and the
operations have been shown. The operation on data item is denoted by and
operation on data item is denoted by .

Suppose that the transaction fails immediately after time instance 9. Which of the following statements is
correct?

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

gatecse-2015-set3 databases transaction-and-concurrency normal

Answer key☟

5.17.13 Transaction and Concurrency: GATE CSE 2016 Set 1 | Question: 22

Which one of the following is NOT a part of the ACID properties of database transactions?

A. Atomicity B. Consistency C. Isolation D. Deadlock-freedom


gatecse-2016-set1 databases transaction-and-concurrency easy

Answer key☟

5.17.14 Transaction and Concurrency: GATE CSE 2016 Set 1 | Question: 51

Consider the following two phase locking protocol. Suppose a transaction accesses (for read or write
operations), a certain set of objects . This is done in the following manner:

. acquires exclusive locks to in increasing order of their addresses.


. The required operations are performed .
. All locks are released

This protocol will

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.

gatecse-2016-set1 databases transaction-and-concurrency normal

Answer key☟

5.17.15 Transaction and Concurrency: GATE CSE 2016 Set 2 | Question: 22

Suppose a database schedule involves transactions . Construct the precedence graph of


with vertices representing the transactions and edges representing the conflicts. If is serializable, which one of
the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule?

A. Topological order B. Depth-first order


C. Breadth-first order D. Ascending order of the transaction
indices
gatecse-2016-set2 databases transaction-and-concurrency normal

Answer key☟

5.17.16 Transaction and Concurrency: GATE CSE 2016 Set 2 | Question: 51

Consider the following database schedule with two transactions and .

Where denotes a read operation by transaction on a variable , denotes a write operation by


on a variable and denotes an abort by transaction .
Which one of the following statements about the above schedule is TRUE?

A. is non-recoverable. B. is recoverable, but has a


cascading abort.
C. does not have a cascading D. is strict.
abort.
gatecse-2016-set2 databases transaction-and-concurrency normal

Answer key☟

5.17.17 Transaction and Concurrency: GATE CSE 2017 Set 1 | Question: 42

In a database system, unique timestamps are assigned to each transaction using Lamport's logical clock.
Let and be the timestamps of transactions and respectively. Besides, holds a
lock on the resource and has requested a conflicting lock on the same resource The following algorithm is
used to prevent deadlocks in the database system assuming that a killed transaction is restarted with the same
timestamp.

if then

is killed

else waits.

Assume any transaction that is not killed terminates eventually. Which of the following is TRUE about the database
system that uses the above algorithm to prevent deadlocks?

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.

gatecse-2017-set1 databases timestamp-ordering normal transaction-and-concurrency

Answer key☟

5.17.18 Transaction and Concurrency: GATE CSE 2019 | Question: 11

Consider the following two statements about database transaction schedules:

I. Strict two-phase locking protocol generates conflict serializable schedules that are also recoverable.
II. Timestamp-ordering concurrency control protocol with Thomas’ Write Rule can generate view
serializable schedules that are not conflict serializable

Which of the above statements is/are TRUE?

A. I only B. II only C. Both I and II D. Neither I nor II


gatecse-2019 databases transaction-and-concurrency 1-mark
Answer key☟

5.17.19 Transaction and Concurrency: GATE CSE 2020 | Question: 37

Consider a schedule of transactions and :

Here, RX stands for “Read(X)” and WX stands for “Write(X)”. Which one of the following schedules is conflict
equivalent to the above schedule?

A.

B.

C.

D.

gatecse-2020 databases transaction-and-concurrency 2-marks

Answer key☟

5.17.20 Transaction and Concurrency: GATE CSE 2021 Set 1 | Question: 13

Suppose a database system crashes again while recovering from a previous crash. Assume checkpointing
is not done by the database either during the transactions or during recovery.
Which of the following statements is/are correct?

A. The same undo and redo list will be used while recovering again
B. The system cannot recover any further
C. All the transactions that are already undone and redone will not be recovered again
D. The database will become inconsistent

gatecse-2021-set1 multiple-selects databases transaction-and-concurrency 1-mark

Answer key☟

5.17.21 Transaction and Concurrency: GATE CSE 2024 | Set 2 | Question: 17

​Which of the following statements about the Two Phase Locking ( ) protocol is/are TRUE?

A. permits only serializable schedules


B. With , a transaction always locks the data item being read or written just before every operation and always
releases the lock just after the operation
C. With , once a lock is released on any data item inside a transaction, no more locks on any data item can be
obtained inside that transaction
D. A deadlock is possible with

gatecse2024-set2 databases two-phase-locking-protocol multiple-selects transaction-and-concurrency

Answer key☟
5.17.22 Transaction and Concurrency: GATE CSE 2024 | Set 2 | Question: 9

Once the informs the user that a transaction has been successfully completed, its effect should
persist even if the system crashes before all its changes are reflected on disk. This property is called

A. durability B. atomicity C. consistency D. isolation


gatecse2024-set2 databases transaction-and-concurrency

Answer key☟

5.17.23 Transaction and Concurrency: GATE IT 2004 | Question: 21

Which level of locking provides the highest degree of concurrency in a relational database ?

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

gateit-2004 databases normal transaction-and-concurrency

Answer key☟

5.17.24 Transaction and Concurrency: GATE IT 2004 | Question: 77

Consider the following schedule of transactions and

Which of the following is TRUE about the schedule ?

A. is serializable only as
B. is serializable only as
C. is serializable both as and
D. is not serializable either as or as

gateit-2004 databases transaction-and-concurrency normal

Answer key☟

5.17.25 Transaction and Concurrency: GATE IT 2005 | Question: 24

Amongst the ACID properties of a transaction, the 'Durability' property requires that the changes made to the
database by a successful transaction persist

A. Except in case of an Operating System crash


B. Except in case of a Disk crash
C. Except in case of a power failure
D. Always, even if there is a failure of any kind

gateit-2005 databases transaction-and-concurrency easy

Answer key☟

5.17.26 Transaction and Concurrency: GATE IT 2005 | Question: 67

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 enhance it by
If commission enhance it by
If commission enhance it by
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:

T1 Update salesinfo
Set commission = commission * 1.02
Where commission < = 50000;

T2 Update salesinfo
Set commission = commission * 1.04
Where commission > 50000 and
commission is < = 100000;

T3 Update salesinfo
Set commission = commission * 1.06
Where commission > 100000;

Which of the following options of running these transactions will update the commission of all salespersons correctly

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

gateit-2005 databases transaction-and-concurrency normal

Answer key☟

5.17.27 Transaction and Concurrency: GATE IT 2007 | Question: 66

Consider the following two transactions and

Which of the following schemes, using shared and exclusive locks, satisfy the requirements for strict two phase
locking for the above transactions?
A.

B.

C.

D.

gateit-2007 databases transaction-and-concurrency normal

Answer key☟
5.17.28 Transaction and Concurrency: GATE IT 2008 | Question: 63

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

Which of the following statements is TRUE?

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

gateit-2008 databases transaction-and-concurrency normal

Answer key☟

Answer Keys
5.1.1 N/A 5.1.2 N/A 5.1.3 N/A 5.1.4 N/A 5.1.5 B
5.1.6 N/A 5.1.7 B 5.1.8 N/A 5.1.9 N/A 5.1.10 N/A
5.1.11 C 5.1.12 B 5.1.13 C 5.1.14 D 5.1.15 A
5.1.16 C 5.1.17 C 5.1.18 B 5.1.19 5 5.1.20 50
5.1.21 A 5.1.22 52 5.1.23 B 5.1.24 A 5.1.25 C
5.1.26 A 5.1.27 C 5.1.28 A 5.1.29 A 5.2.1 N/A
5.2.2 A 5.2.3 8 5.2.4 19 5.2.5 B 5.3.1 D
5.3.2 C 5.3.3 A 5.3.4 54 5.3.5 B 5.3.6 B
5.3.7 A 5.3.8 B;C;D 5.4.1 False 5.5.1 True 5.5.2 N/A
5.5.3 N/A 5.5.4 N/A 5.5.5 N/A 5.5.6 N/A 5.5.7 A;B;D
5.5.8 False 5.5.9 N/A 5.5.10 A 5.5.11 D 5.5.12 N/A
5.5.13 B 5.5.14 D 5.5.15 B 5.5.16 C 5.5.17 A
5.5.18 N/A 5.5.19 C 5.5.20 C 5.5.21 D 5.5.22 B
5.5.23 C 5.5.24 D 5.5.25 C 5.5.26 D 5.5.27 C
5.5.28 C 5.5.29 B 5.5.30 A 5.5.31 B 5.5.32 A
5.5.33 C 5.5.34 B 5.5.35 B 5.5.36 A 5.5.37 B
5.5.38 C 5.5.39 A 5.5.40 A 5.5.41 A;C;D 5.5.42 8
5.5.43 A 5.5.44 A;C 5.5.45 B;C;D 5.5.46 50 5.5.47 A;B;D
5.5.48 Q-Q 5.5.49 B 5.5.50 A 5.5.51 B 5.5.52 B
5.5.53 A 5.5.54 D 5.5.55 A 5.6.1 B 5.6.2 B
5.6.3 A 5.6.4 C 5.6.5 4 5.6.6 C 5.6.7 A
5.6.8 A 5.6.9 D 5.6.10 A 5.6.11 B 5.6.12 C
5.7.1 N/A 5.7.2 N/A 5.7.3 3 5.7.4 C 5.7.5 A
5.7.6 C 5.7.7 C 5.7.8 C 5.7.9 C 5.7.10 4
5.7.11 698 : 698 5.7.12 6 5.7.13 A;B 5.8.1 A 5.8.2 A
5.8.3 A 5.8.4 C 5.8.5 B 5.8.6 A 5.8.7 A
5.9.1 C 5.10.1 C 5.10.2 A 5.10.3 C 5.11.1 N/A
5.12.1 B 5.12.2 C 5.12.3 A 5.12.4 0.00 5.12.5 D
5.13.1 N/A 5.13.2 N/A 5.13.3 N/A 5.13.4 N/A 5.13.5 N/A
5.13.6 N/A 5.13.7 D 5.13.8 N/A 5.13.9 B 5.13.10 C
5.13.11 D 5.13.12 C 5.13.13 N/A 5.13.14 A 5.13.15 D
5.13.16 B 5.13.17 D 5.13.18 A 5.13.19 D 5.13.20 D
5.13.21 4 5.13.22 C 5.13.23 1 5.13.24 C 5.13.25 A;B
5.13.26 2 5.13.27 B 5.13.28 C 5.13.29 B 5.14.1 N/A
5.14.2 N/A 5.14.3 D 5.14.4 C 5.14.5 C 5.14.6 C
5.14.7 B 5.14.8 C 5.14.9 C 5.14.10 A 5.14.11 A
5.14.12 D 5.14.13 D 5.14.14 D 5.14.15 C 5.15.1 A
5.16.1 N/A 5.16.2 N/A 5.16.3 N/A 5.16.4 N/A 5.16.5 N/A
5.16.6 N/A 5.16.7 D 5.16.8 N/A 5.16.9 N/A 5.16.10 A
5.16.11 C 5.16.12 N/A 5.16.13 C 5.16.14 N/A 5.16.15 N/A
5.16.16 N/A 5.16.17 C 5.16.18 D 5.16.19 D 5.16.20 C
5.16.21 B 5.16.22 C 5.16.23 A 5.16.24 X 5.16.25 A
5.16.26 C 5.16.27 A 5.16.28 C 5.16.29 C 5.16.30 B
5.16.31 D 5.16.32 B 5.16.33 C 5.16.34 D 5.16.35 2
5.16.36 A 5.16.37 2 5.16.38 2.6 5.16.39 7 5.16.40 D
5.16.41 5 5.16.42 A 5.16.43 819 : 820 ; 205 : 205 5.16.44 B 5.16.45 2
5.16.46 2 5.16.47 3 5.16.48 A;B 5.16.49 D 5.16.50 C
5.16.51 C 5.16.52 D 5.16.53 A 5.16.54 B 5.16.55 D
5.17.1 D 5.17.2 D 5.17.3 D 5.17.4 B 5.17.5 C
5.17.6 B 5.17.7 B 5.17.8 A 5.17.9 B 5.17.10 B
5.17.11 A 5.17.12 B 5.17.13 D 5.17.14 A 5.17.15 A
5.17.16 C 5.17.17 A 5.17.18 C 5.17.19 A 5.17.20 A
5.17.21 A;C;D 5.17.22 A 5.17.23 C 5.17.24 X 5.17.25 D
5.17.26 D 5.17.27 C 5.17.28 D

You might also like