Gate
Exam
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=l) 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;
option
(A) 127
(B) 255
(C) 129
(D) 257
Read Solution (Total 1)
-
- ANS IS OPTION A BECAUSE X=1 Y=1, X=2 Y=3 , X=3 Y=7 , X=4 Y=15 , X=5 Y=31 ,X=6 Y=63 , X=7 Y =127
- 10 years agoHelpfull: Yes(1) No(0)
Gate Other Question