GATE 2011 CS (CS1) – Question 42
An integer table T(X,Y) initially contains (1,1). Let MX,MY be current maxima of its columns. Insert (MX+1,2MY+1), recomputing maxima each time, 128 times. What does SELECT Y FROM T WHERE X=7 return?
Practise this question in The GATE Grind →
Show answer and explanation
Correct answer: (A) 127
Explanation
New rows have X=2,3,… and their Y values satisfy Yₖ=2Yₖ₋₁+1 with Y₁=1. Solving gives Yₖ=2ᵏ−1. At X=7 the value is 128−1=127, A. Later inserts do not alter that existing row.
More Relational Model: Relational Algebra, Tuple Calculus, SQL questions
- GATE 2011 CS (CS1) Q56
- GATE 2010 CS (CS1) Q29
- GATE 2010 CS (CS1) Q53
- GATE 2015 CS (CS2) Q40
- GATE 2015 CS (CS3) Q29
- GATE 2021 CS (CS2) Q41
All Relational Model: Relational Algebra, Tuple Calculus, SQL questions →