1
GATE CSE 2000
MCQ (Single Correct Answer)
+2
-0.6
Given relations r( w, x ) and s( y, z ), the result of

select distinct w,x
from r, s;
is guaranteed to be same as r, provided
A
r has no duplicates and s is non-empty
B
r and s have no duplicates
C
s has no duplicates and r is non-empty
D
r and s have the same number of tuples
2
GATE CSE 1999
MCQ (Single Correct Answer)
+2
-0.6
Which of the following is/are correct?
A
An SQL query automatically eliminates duplicates.
B
An SQL query will not work if there are no indexes on the relations.
C
SQL permits attribute names to be repeated in the same relation.
D
None of the above.
3
GATE CSE 1999
Subjective
+2
-0
Consider the set of relations

EMP (Employee-no, Dept-no, Employee-name, Salary)
DEPT (Dept-no, Dept-name, Location)

Write an SQL query to:

(a) Find all employee names who work in departments located at "Calcutta" and whose salary is greater than Rs.50,000.

(b) Calculate, for each department number, the number of employees with a salary greater than Rs.1,00,000.

4
GATE CSE 1998
Subjective
+2
-0

Suppose we have a database consisting of the following three relations.

FREQUENTS (student, parlor) giving the parlors each student visits.

SERVES (parlor, ice-cream) indicating what kind of ice-creams each parlor serves.

LIKES (student, ice-cream) indicating what ice-creams each student likes.

(Assume that each student likes at least one ice-cream and frequents at least one parlor)

Express the following in SQL:
Print the students that frequent at least one parlor that serves some ice-cream that they like.

GATE CSE Subjects
Software Engineering
Web Technologies
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
CBSE
Class 12