1
GATE CSE 2014 Set 2
MCQ (Single Correct Answer)
+2
-0.6
SQL allows duplicate tuples in relations, and correspondingly defines the multiplicity of tuples in the result of joins. Which one of the following queries always gives the same answer as the nested query shown below:
Select * from R where a in (select S.a from S)
A
Select R.* from R, S where R.a = S.a
B
Select distinct R.* from R, S where R.a = S.a
C
Select R.* from R, (select distinct a from S) as S1 where R.a = S1.a
D
Select R.* from R, S where R.a = S.a and is unique R
2
GATE CSE 2013
MCQ (Single Correct Answer)
+2
-0.6

Consider the following relational schema.

Students(rollno: integer, sname: string)

Courses(courseno: integer, cname: string)

Registration(rollno: integer, courseno: integer, percent: real)

Which of the following queries are equivalent to this query in English?

"Find the distinct names of all students who score more than 90% in the course numbered 107"

(I) SELECT DISTINCT S.sname 
FROM Students as S, Registration as R 
WHERE R.rollno=S.rollno AND 
R.courseno=107 AND R.percent >90

(II) ∏snamecourseno = 107 ∧ percent > 90 (Registration ⋈ Students))

(III) { T | ∃S ∈ Students, ∃R ∈ Registration ( S.rollno=R.rollno ∧ R.courseno=107 ∧ R.percent > 90 ∧ T.sname=S.sname)}

(iv) { < SN >| ∃SR∃RP ( < SR, SN > ∈ Students ∧ ∈ Registration ∧ RP > 90)}

A
I, II, III and IV
B
I, II and III only
C
I, II and IV only
D
II, III and IV only
3
GATE CSE 2011
MCQ (Single Correct Answer)
+2
-0.6

Database table by name Loan_Records is given below.

Borrower Bank_Manager Loan_Amount
Ramesh Sunderajan 10000.00
Suresh Ramgopal 5000.00
Mahesh Sunderajan 7000.00

What is the output of the following SQL query?

SELECT count(*) 
FROM ( 
(SELECT Borrower. Bank_Manager FROM Loan_Records) AS S 
NATURAL JOIN 
(SELECT Bank_Manager, Loan_Amount FROM Loan_Records) AS T );
A
3
B
9
C
5
D
6
4
GATE CSE 2011
MCQ (Single Correct Answer)
+2
-0.6

Consider a database table T containing two columns X and Y each of type integer. After the creation of the table, one record (X = 1, Y = 1) is inserted in the table.

Let MX and MY denote the respective maximum values of X and Y among all records in the table at any point in time. Using MX and MY, new records are inserted in the table 128 times with X and Y values being MX + 1, 2*MY + 1 respectively. It may be noted that each time after the insertion, values of MX and MY change.

What will be the output of the following SQL query after the steps mentioned above are carried out?

SELECT Y FROM T WHERE X=7; 
A
127
B
255
C
129
D
257
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