1
GATE CSE 2019
Numerical
+2
-0.67
A relational database contains two tables Student and Performance as shown below:
GATE CSE 2019 Database Management System - Structured Query Language Question 3 English
The primary key of the Student table is Roll_no. For the Performance table, the columns Roll_no. and Subject_code together from the primary key. Consider the SQL query given below:

SELECT S.Student_name, sum (P.Marks)
       FROM Student S, Performance P
       WHERE P.Marks > 84
       GROUP BY S.Student_name;


The number of rows returned by the above SQL query is _____.
Your input ____
2
GATE CSE 2016 Set 2
Numerical
+2
-0
Consider the following database table named $$water$$_$$schemes :$$

water_schemes
scheme_no district_name capacity
1 Ajmer 20
1 Bikaner 10
2 Bikaner 10
3 Bikaner 20
1 Churu 10
2 Churu 20
1 Dungargarh 10

The number of tuples returned by the following $$SQL$$ query is _______________.

with total(name, capacity) as
    select district_name, sum(capacity)
    from water_schemes
    group by district_name
with total_avg(capacity) as
    select avg(capacity)
    from total
select name
    from total, total_avg
    where total.capacity ≥ total_avg.capacity
Your input ____
3
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 ____
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?
A
It executes but does not give the correct result.
B
It executes and gives the correct result.
C
It generates an error because of pairwise comparison.
D
It generates an error because the GROUP BY clause cannot be used with table joins in a sub-query.
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