Databases questions

Q13

GATE CS 2015 CS-3Relational DesignMCQ1 mark−1/3 if wrong
Consider the relation X(P,Q,R,S,T,U)X(P, Q, R, S, T, U) with the following set of functional dependencies

F={{P,R}→{S,T},{P,S,U}→{Q,R}}F = \{\{P, R\} \to \{S, T\}, \{P, S, U\} \to \{Q, R\}\}

Which of the following is the trivial functional dependency in F+F^+, where F+F^+ is closure of FF ?
Show answer without attempting

Answer: C

Q29

GATE CS 2015 CS-3Relational QueriesMCQ1 mark−1/3 if wrong
Consider the following relation

Cinema(theater, address, capacity)

Which of the following options will be needed at the end of the SQL query
SELECT P1.address
FROM Cinema P1
such that it always finds the addresses of theaters with maximum capacity?
Show answer without attempting

Answer: A

Q39

GATE CS 2015 CS-3Storage and IndexingNAT2 marks
Consider a B+ tree in which the search key is 12 bytes long, block size is 1024 bytes, record pointer is 10 bytes long and block pointer is 8 bytes long. The maximum number of keys that can be accommodated in each non-leaf node of the tree is ____________.
Show answer without attempting

Answer: 50

Q51

GATE CS 2015 CS-3TransactionsMCQ2 marks−2/3 if wrong
Consider the following partial Schedule SS involving two transactions T1T1 and T2T2. Only the read and the write operations have been shown. The read operation on data item PP is denoted by read(P) and the write operation on data item PP is denoted by write(P).
Time instanceT1T2
1read(A)
2write(A)
3read(C)
4write(C)
5read(B)
6write(B)
7read(A)
8commit
9read(B)
Schedule S

Suppose that the transaction T1T1 fails immediately after time instance 9. Which one of the following statements is correct?
Show answer without attempting

Answer: B

Q31

GATE CS 2015 CS-1Relational QueriesMCQ1 mark−1/3 if wrong
SELECT operation in SQL is equivalent to
Show answer without attempting

Answer: D

Q32

GATE CS 2015 CS-1Storage and IndexingMCQ1 mark−1/3 if wrong
A file is organized so that the ordering of data records is the same as or close to the ordering of data entries in some index. Then that index is called
Show answer without attempting

Answer: C

Q48

GATE CS 2015 CS-1Data ModelsNAT2 marks
Consider an Entity-Relationship (ER) model in which entity sets E1E_1 and E2E_2 are connected by an m:nm : n relationship R12R_{12}. E1E_1 and E3E_3 are connected by a 1:n1 : n (1 on the side of E1E_1 and nn on the side of E3E_3) relationship R13R_{13}.

E1E_1 has two single-valued attributes a11a_{11} and a12a_{12} of which a11a_{11} is the key attribute. E2E_2 has two single-valued attributes a21a_{21} and a22a_{22} of which a21a_{21} is the key attribute. E3E_3 has two single-valued attributes a31a_{31} and a32a_{32} of which a31a_{31} is the key attribute. The relationships do not have any attributes.

If a relational model is derived from the above ER model, then the minimum number of relations that would be generated if all the relations are in 3NF is ________.
Show answer without attempting

Answer: 4

Q61

GATE CS 2015 CS-1Relational QueriesNAT2 marks
Consider the following relations:

Student
Roll_NoStudent_Name
1Raj
2Rohit
3Raj
Performance
Roll_NoCourseMarks
1Math80
1English70
2Math75
3English80
2Physics65
3Math80
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 number of rows that will be returned by the SQL query is ________.
Show answer without attempting

Answer: 2

Q31

GATE CS 2015 CS-2TransactionsMCQ1 mark−1/3 if wrong
Consider the following transaction involving two bank accounts x and y.
read(x); x := x - 50; write(x); read(y); y:= y + 50; write(y)
The constraint that the sum of the accounts x and y should remain constant is that of
Show answer without attempting

Answer: B

Q32

GATE CS 2015 CS-2Storage and IndexingNAT1 mark
With reference to the B+ tree index of order 1 shown below, the minimum number of nodes (including the Root node) that must be fetched in order to satisfy the following query: "Get all records with a search key greater than or equal to 7 and less than 15" is ____________.
Question figure
Show answer without attempting

Answer: 5

Q39

GATE CS 2015 CS-2TransactionsMCQ2 marks−2/3 if wrong
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?
Show answer without attempting

Answer: A

Q40

GATE CS 2015 CS-2Relational QueriesMCQ2 marks−2/3 if wrong
Consider two relations R1(A,B)R_1(A,B) with the tuples (1,5), (3,7) and R2(A,C)R_2(A,C) = (1,7), (4,9). Assume that R(A,B,C) is the full natural outer join of R1R_1 and R2R_2. Consider the following tuples of the form (A,B,C): a = (1,5,null), b = (1,null,7), c = (3,null,9), d = (4,7,null), e = (1,5,7), f = (3,7,null), g = (4,null,9). Which one of the following statements is correct?
Show answer without attempting

Answer: C

0/120 correct0 marks

Related topics in GATE CS