Database Management System


Question 1
Consider a database of fixed-length records, stored as an ordered file. The database has 25,000 records, with each record being 100 bytes, of which the primary key occupies 15 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 1024 bytes, and a pointer to a block occupies 5 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 b blocks takes \left \lceil \log_2 b \right \rceil 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 _____
A
4
B
6
C
8
D
16
GATE CSE 2023      File System
Question 2
Consider the following table named Student in a relational database. The primary key of this table is rollNum.
\begin{array}{|c|c|c|c|} \hline \\ rollNum&name&gender&marks \\ \hline 1&Naman&M&62\\ \hline 2&Aliya&F&70 \\ \hline 3&Aliya &F&80 \\ \hline 4&James&M&82\\ \hline 5&Swati&F&65\\ \hline \end{array}
The SQL 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 ______
A
0
B
1
C
2
D
3
GATE CSE 2023      SQL


Question 3
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.
GATE CSE 2023      Relational Schema
Question 4
Consider the relational database with the following four schemas and their respective instances.


The number of rows returned by the above SQL query is ___
A
1
B
2
C
4
D
8
GATE CSE 2022      SQL
Question 5
Let R_i(z) and W_i(z) denote read and write operations on a data element z by a transaction T_i, respectively. Consider the schedule S with four transactions.

S: R_4(x)R_2(x)R_3(x)R_1(y)W_1(y)W_2 (x)W_3 (y)R_4(y)

Which one of the following serial schedules is conflict equivalent to S?
A
T_1\rightarrow T_3\rightarrow T_4\rightarrow T_2
B
T_1\rightarrow T_4\rightarrow T_3\rightarrow T_2
C
T_4\rightarrow T_1\rightarrow T_3\rightarrow T_2
D
T_3\rightarrow T_1\rightarrow T_4\rightarrow T_2
GATE CSE 2022      Transaction




There are 5 questions to complete.

Leave a Comment