1
GATE CSE 2006
MCQ (Single Correct Answer)
+2
-0.6

Consider the relation "enrolled (student, course)" in which (student, course) is the primary key, and the relation "paid (student, amount)" where student is the primary key. Assume no null values and no foreign keys or integrity constraints. Given the following four queries:

Query 1:

Select student 
from enrolled 
where student in (select student from paid)

Query 2:

Select student 
from paid 
where student in (select student from enrolled)

Query 3:

Select E.student 
from enrolled E, paid P 
where E.student = P.student

Query 4:

Select student 
from paid 
where exists (Select * 
              from enrolled 
              where enrolled.student = paid.student)

Which one of the following statements is correct?

A
All queries return identical row sets for any database
B
Query 2 and Query 4 return identical row sets for all databases but there exist databases for which Query 1 and Query 2 return different row sets.
C
There exist databases for which Query 3 returns strictly fewer rows than Query 2
D
There exist databases for which Query 4 will encounter an integrity violation at runtime.
2
GATE CSE 2006
MCQ (Single Correct Answer)
+2
-0.6
Consider the relation account (customer, balance) where customer is a primary key and there are no null values. We would like to rank customers according to decreasing balance. The customer with the largest balance gets rank 1. Ties are not broke but ranks are skipped: if exactly two customers have the largest balance they each get rank 1 and rank 2 is not assigned.
Query1:
  Select A.customer, count(B.customer)
  From account A, account B
  Where A.balance <=B.balance
  Group by A.customer

Query2:
  Select A.customer, 1+count(B.customer)
  From account A, account B
  Where A.balance < B.balance
  Group by A.customer

Consider these statements about Query1 and Query2.

1. Query1 will produce the same row set as Query2 for some but not all databases.

2. Both Query1 and Query2 are correct implementation of the specification

3. Query1 is a correct implementation of the specification but Query2 is not

4. Neither Query1 nor Query2 is a correct implementation of the specification

5. Assigning rank with a pure relational query takes less time than scanning in decreasing balance order assigning ranks using ODBC.

Which two of the above statements are correct?

A
2 and 5
B
1 and 3
C
1 and 4
D
3 and 5
3
GATE CSE 2006
MCQ (Single Correct Answer)
+2
-0.6
The following functional dependencies are given :
$$\eqalign{ & AB \to CD,\,AF \to D,\,\,DE \to F, \cr & C \to G.\,\,\,\,\,\,\,\,\,\,F \to E.\,\,\,\,\,\,\,\,\,G \to A. \cr} $$

Which one of the following options is false?

A
$${\left\{ {CF} \right\}^ + }\,\,\, = \left\{ {ACDEFG} \right\}$$
B
$${\left\{ {BG} \right\}^ + }\,\, = \left\{ {ABCDG} \right\}$$
C
$${\left\{ {AF} \right\}^ + }\,\, = \left\{ {ACDEFG} \right\}$$
D
$${\left\{ {AB} \right\}^ + }\,\, = \left\{ {ABCDG} \right\}$$
4
GATE CSE 2006
MCQ (Single Correct Answer)
+2
-0.6
Consider the relation enrolled (student, course) in which (student, course ) is the primary key, and the relation Paid (student, amount) where student is the primary key. Assume no null values and no foreign keys or integrity constraints. Assume that amounts $$6000, 7000, 8000,9000$$ and $$10000$$ were each paid by $$20$$% of the students. Consider these query plans (Plan $$1$$ on left, Plan $$2$$ on right) to ''List all courses taken by students who have paid more than $$x''$$. GATE CSE 2006 Database Management System - Functional Dependencies and Normalization Question 22 English 1 GATE CSE 2006 Database Management System - Functional Dependencies and Normalization Question 22 English 2

A disk seek takes $$4ms$$, disk data transfer bandwidth is $$300MB/s$$ and checking a tuple to see if amount is greater than $$x$$ takes $$10\mu s.$$ Which of the following statements is correct?

A
Plan $$1$$ and Plan $$2$$ will not output identical row sets for all databases
B
A course may be listed more than once in the output of plan $$1$$ for some databases
C
For $$x=5000,$$ Plan $$1$$ executes faster than plan $$2$$ for all databases
D
For $$x=9000,$$ Plan $$1$$ executes slower than plan $$2$$ for all databases
EXAM MAP
Medical
NEETAIIMS
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
Staff Selection Commission
SSC CGL Tier I
CBSE
Class 12