1
GATE CSE 2014 Set 1
MCQ (Single Correct Answer)
+1
-0.3
Given the following statements:

S1: A foreign key declaration can always be replaced by an equivalent check assertion in SQL.

S2: Given the table R(a,b,c) where a and b together form the primary key, the following is a valid table definition.

CREATE TABLE S (
 a INTEGER,
 d INTEGER,
 e INTEGER,
 PRIMARY KEY (d),
 FOREIGN KEY (a) references R)

Which one of the following statements is CORRECT?

A
S1 is TRUE and S2 is FALSE.
B
Both S1 and S2 are TRUE.
C
S1 is FALSE and S2 is TRUE.
D
Both S1 and S2 are FALSE.
2
GATE CSE 2012
MCQ (Single Correct Answer)
+1
-0.3
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

A
P and R
B
P and S
C
Q and R
D
Q and S
3
GATE CSE 2010
MCQ (Single Correct Answer)
+1
-0.3

A relational schema for a train reservation database is given below:

Passenger ( pid, pname, age)
Reservation (pid, cass, tid)

Table: Passenger

pid pname age
0 'Sachin' 65
1 'Rahul' 66
2 'Sourav' 67
3 'Anil' 69

Table: Reservation

pid class tid
0 'AC' 8200
1 'AC' 8201
2 'SC' 8201
5 'AC' 8203
1 'SC' 8204
3 'AC' 8202

What pids are returned by the following SQL query for the above instance of the tables?

SELECT   pid
FROM   Reservation
WHERE   class 'AC' AND 
EXISTS (SELECT * 
FROM Passenger 
WHERE age > 65 
AND Passenger.pid = Reservation.pid);
A
1, 0
B
1, 2
C
1, 3
D
1, 5
4
GATE CSE 2004
MCQ (Single Correct Answer)
+1
-0.3
Consider the following relation schema pertaining to a students database:
Students (rollno, name, address)
Enroll(rollno,courseno, coursename)
Where the primary keys are shown underlined. The number of tuples in the student and Enroll tables are 120 and 8 respectively. What are the maximum and minimum number of tuples that can be present in (Student * Enroll), where '*' denotes natural join?
A
8, 8
B
120, 8
C
960, 8
D
960, 120
GATE CSE Subjects
Software Engineering
Web Technologies
EXAM MAP
Medical
NEET
Graduate Aptitude Test in Engineering
GATE CSEGATE ECEGATE EEGATE MEGATE CEGATE PIGATE IN
Civil Services
UPSC Civil Service
Defence
NDA
CBSE
Class 12