Databases questions

Q2

GATE CS 2012 CSRelational DesignMCQ1 mark−1/3 if wrong
Which of the following is TRUE?
Show answer without attempting

Answer: C

Q14

GATE CS 2012 CSData ModelsMCQ1 mark−1/3 if wrong
Given the basic ER and relational models, which of the following is INCORRECT?
Show answer without attempting

Answer: C

Q15

GATE CS 2012 CSRelational QueriesMCQ1 mark−1/3 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
Show answer without attempting

Answer: C

Q27

GATE CS 2012 CSTransactionsMCQ2 marks−2/3 if wrong
Consider the following transactions with data items P and Q initialized to zero:
T1 : read (P);
     read (Q);
     if P = 0 then Q := Q + 1 ;
     write (Q).

T2 : read (Q);
     read (P);
     if Q = 0 then P := P + 1 ;
     write (P).
Any non-serial interleaving of T1T_1 and T2T_2 for concurrent execution leads to
Show answer without attempting

Answer: B

Q43

GATE CS 2012 CSRelational DesignMCQ2 marks−2/3 if wrong
Suppose R1(A‾,B)R_1(\underline{A}, B) and R2(C‾,D)R_2(\underline{C}, D) are two relation schemas. Let r1r_1 and r2r_2 be the corresponding relation instances. B is a foreign key that refers to C in R2R_2. If data in r1r_1 and r2r_2 satisfy referential integrity constraints, which of the following is ALWAYS TRUE?
Show answer without attempting

Answer: A

Q50

GATE CS 2012 CSRelational QueriesMCQ2 marks−2/3 if wrong
How many tuples does the result of the following relational algebra expression contain? Assume that the schema of A∪BA \cup B is the same as that of AA.

(A∪B)⋈A.Id>40∨C.Id<15C(A \cup B) \bowtie_{A.Id > 40 \lor C.Id < 15} C
Show answer without attempting

Answer: A

Q51

GATE CS 2012 CSRelational QueriesMCQ2 marks−2/3 if wrong
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')
Show answer without attempting

Answer: B

0/70 correct0 marks

Related topics in GATE CS