1
GATE CSE 2015 Set 1
Numerical
+2
-0
Consider the following relation:
Student
Roll_No | Student_Name |
---|---|
1 | Raj |
2 | Rohit |
3 | Raj |
Performance
Roll_No | Course | Marks |
---|---|---|
1 | Math | 80 |
1 | English | 70 |
2 | Math | 75 |
3 | English | 80 |
2 | Physics | 65 |
3 | Math | 80 |
Consider the following SQL query.
SELECT S.Student_Name, Sum(P.Marks)
FROM Student S, Performance P
WHERE S.Roll_No= P.Roll_No
GROUP BY S.STUDENT_Name
The numbers of rows that will be returned by the SQL query is___________.Your input ____
2
GATE CSE 2014 Set 3
MCQ (Single Correct Answer)
+2
-0.6
Consider the following relational schema:
employee (empId, empName, empDept )
customer (custId, custName, salesRepId, rating)
SalesRepId is a foreign key referring to empId of the employee relation. Assume that each employee makes a sale to at least one customer. What does the following query return?SELECT empName
FROM employee E
WHERE NOT EXISTS (SELECT custId
FROM customer C
WHERE C.salesRepId = E.empId
AND C.rating <> 'GOOD');
3
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)
4
GATE CSE 2014 Set 1
MCQ (Single Correct Answer)
+2
-0.6
Given the following schema:
employees(emp-id, first-name, last-name, hire-date, dept-id, salary)
departments(dept-id, dept-name, manager-id, location-id)
You want to display the last names and hire dates of all latest hires in their respective departments in the location ID 1700. You issue the following query:SQL> SELECT last-name, hire-date
FROM employees WHERE (dept-id, hire-date) IN
(SELECT dept-id, MAX(hire-date)
FROM employees JOIN departments USING(dept-id)
WHERE location-id = 1700
GROUP BY dept-id);
What is the outcome?Questions Asked from Structured Query Language (Marks 2)
Number in Brackets after Paper Indicates No. of Questions
GATE CSE 2023 (1)
GATE CSE 2022 (1)
GATE CSE 2021 Set 2 (1)
GATE CSE 2019 (1)
GATE CSE 2016 Set 2 (1)
GATE CSE 2015 Set 1 (1)
GATE CSE 2014 Set 3 (1)
GATE CSE 2014 Set 2 (1)
GATE CSE 2014 Set 1 (1)
GATE CSE 2013 (1)
GATE CSE 2011 (2)
GATE CSE 2009 (2)
GATE CSE 2008 (2)
GATE CSE 2007 (1)
GATE CSE 2006 (4)
GATE CSE 2005 (3)
GATE CSE 2004 (3)
GATE CSE 2003 (1)
GATE CSE 2000 (2)
GATE CSE 1999 (2)
GATE CSE 1998 (1)
GATE CSE Subjects
Theory of Computation
Operating Systems
Algorithms
Database Management System
Data Structures
Computer Networks
Software Engineering
Compiler Design
Web Technologies
General Aptitude
Discrete Mathematics
Programming Languages