GATE 2012 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2012

82 questions

MCQ 821-mark 39 · 2-mark 43

Questions 51–55 of 82

Q51Relational Algebra2 marksMCQ−0.67 if wrong
Consider the following relations A, B and C:
A Id Name Age 12 Arun 60 15 Shreya 24 99 Rohit 11 B Id Name Age 15 Shreya 24 25 Hari 40 98 Rohit 20 99 Rohit 11 C Id Phone Area 10 2200 02 99 2100 01
How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A∪\cupB is the same as that of A.
(A∪B)⋈A.Id>40∨C.Id<15C(A\cup B)\bowtie _{A.Id \gt 40 \vee C.Id \lt 15}C

Q52Relational Algebra2 marksMCQ−0.67 if wrong
Suppose R1(A, B) and R2(C, D) are two relation schemas. Let r1 and r2 be the corresponding relation instances. B is a foreign key that refers to C in R2. If data in r1 and r2 satisfy referential integrity constraints, which of the following is ALWAYS TRUE?

Q53SQL2 marksMCQ−0.67 if wrong
Consider the following relations A, B and C:
A Id Name Age 12 Arun 60 15 Shreya 24 99 Rohit 11 B Id Name Age 15 Shreya 24 25 Hari 40 98 Rohit 20 99 Rohit 11 C Id Phone Area 10 2200 02 99 2100 01
How many tuples does the result of the following SQL query contain?
 SELECT A.Id
FROM A
WHERE A.Age > ALL (SELECT B.Age
FROM B
WHERE B.Name = 'Arun') 

Q54SQL1 markMCQ−0.33 if wrong
Which of the following statements are TRUE about an SQL query?
P : An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause
Q : An SQL query can contain a HAVING clause only if it has a GROUP BY clause
R : All attributes used in the GROUP BY clause must appear in the SELECT clause
S : Not all attributes used in the GROUP BY clause need to appear in the SELECT clause

Q55Normal Form1 markMCQ−0.33 if wrong
Which of the following is TRUE?