Skip to content
Related Articles

Related Articles

Improve Article

GATE | GATE CS 2011 | Question 32

  • Difficulty Level : Hard
  • Last Updated : 28 Jun, 2021

Consider a database table T containing two columns X and Y each of type integer. After the creation of the table, one record (X=1, Y=1) is inserted in the table.

Let MX and My denote the respective maximum values of X and Y among all records in the table at any point in time. Using MX and MY, new records are inserted in the table 128 times with X and Y values being MX+1, 2*MY+1 respectively. It may be noted that each time after the insertion, values of MX and MY change. What will be the output of the following SQL query after the steps mentioned above are carried out?

SELECT Y FROM T WHERE X=7;

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


Answer: (A)

Explanation: See Question 4 of https://www.geeksforgeeks.org/database-management-systems-set-4/

And question 30 of http://clweb.csa.iisc.ernet.in/rahulsharma/gate2011key.html

Quiz of this Question

Attention reader! Don’t stop learning now.  Practice GATE exam well before the actual exam with the subject-wise and overall quizzes available in GATE Test Series Course.

Learn all GATE CS concepts with Free Live Classes on our youtube channel.

My Personal Notes arrow_drop_up
Recommended Articles
Page :