PREVIOUS YEAR SOLVED PAPERS - GATE 2019

61. A relational database contains two tables Student and Performance as shown below:

The primary key of the Student table is Roll_no. For the Performance table, the columns Roll_no. and Subject_code together form the primary key. Consider the SQL query given below:
 SELECT S.Student_name, sum(P.Marks)
 FROM Student S, Performance P
 WHERE P.Marks > 84
 GROUP BY S.Student_name;
 The number of rows returned by the above SQL query is ________.

Note – Numerical Type question

  • Option : B
  • Explanation :
    Gate2019 cs
    Total 5 different student names all 5 group records in result. (In where condition no condition over Roll_no so query produces all groups.)
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


62. Consider the following C program:

 int main(){
  float sum = 0.0, j = 1.0, i = 2.0;
  while (i/j > 0.0625){
  j = j + j;
  sum = sum + i/j;
  printf("%f\n", sum);
  }
  return 0;
  }
  The number of times the variable sum will be printed, when the above program is executed, is _________________.

Note: Numerical Type question.

  • Option : A
  • Explanation :
    According to “while” loop,

    Initially i = 2.0, j = 1.0
    i / j = 2.0 / 1. 0 = 2.0 > 0.0625

    j = j + j
    j = 2.0
    printed sum = 0.0

    Second time,
    i / j = 1 > 0.0625
    j = 4
    printed sum = 0.0

    Third time,
    i / j = 0.5 > 0.0625
    j = 8
    printed sum = 0.0

    Fourth time,
    i / j = 0.25 > 0.0625
    j = 16
    printed sum = 0.0

    Fifth time,
    i / j = 0.125 > 0.0625
    j = 32
    printed sum = 0.0

    Sixth time,
    i / j = 0.0625 = 0.0625
    It violates the greater then condition.
    This time while loop will not execute.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


63. Consider the following C program:

  int main()
  {
  int a[] = {2, 4, 6, 8, 10};
  int i, sum = 0, *b = a + 4;
  for (i = 0; i < 5; i++)
  sum = sum + (*b – i) – *(b – i);
  printf (“%d\n”, sum);
  return 0;
  }
  The output of the above C program is __________.

Note – Numerical Type question

  • Option : D
  • Explanation :
    Given, “for” loop will run from i=0 to 4.
    i = 0
    sum = 0+ 10 – 10 = 0
    i = 1
    sum = 0 + 9 – 8 = 1
    i = 2
    sum = 1 + 8 – 6 = 3
    i = 3
    sum = 3 + 7 – 4 = 6
    i = 4
    sum = 6 + 6 – 2 = 10
    Now, loop terminate and value of sum (i.e., 10) will be printed. So, The output of above C program is 10.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


64. In an RSA cryptosystem, the value of the public modulus parameter 𝑛 is 3007 is If it is also known that φ(𝑛) = 2880, where φ() denotes Euler’s Totient Function, then the prime factor of 𝑛 which is greater than 50 is ____________________.

  • Option : A
  • Explanation :
    n = p × q = 3007
    By RSA algorithm, n = 31 × 97 in which 97 is prime factor which greater than 50.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


65. Consider the following relations P(X,Y,Z), Q(X,Y,T) and R(Y,V).

P Q R
XYZ XYT YV
X1Y1Z1 X2Y12 Y1V1
X1Y1Z2 X1Y25 Y3V2
X2Y2Z2 X1Y16 Y2V3
X2Y4Z4 X3Y31 Y2V2
How many tuples will be returned by the following relational algebra query?
πx(P.Y = R.Y ∧ R.V = V2)(P X R)) - πx(Q.Y = R.Y ∧ Q.T > 2(Q X R))

Note – Numerical Type question

  • Option : B
  • Explanation :
    Gate2019 cs
    πx(P.Y = R.Y ∧ R.V = V2)(P X R)) ⇒
    X
    X2
    .........(I)
    Gate2019 cs
    Πx(Q.Y = R.Y ∧ Q.T > 2) (Q × R)) ⇒
    X
    X1
    .........(II)
    I – II ⇒
    X
    X2
    one record in result.
Cancel reply

Your email address will not be published. Required fields are marked *


Cancel reply

Your email address will not be published. Required fields are marked *


Related Quiz.
GATE 2019