GATE Computer Science (CS) 2017 Shift 1 Solved Paper

© examsiri.com
Question : 33 of 65
 
Marks: +1, -0
Consider a database that has the relation schema EMP (EmpId, EmpName, and DeptName). An instance of the schema EMP and a SQL query on it are given below.
EMP
EmpId
EmpName
DeptName
1
XYA
AA
2
XYB
AA
3
XYC
AA
4
XYD
AA
5
XYE
AB
6
XYF
AB
7
XYG
AB
8
XYH
AC
9
XYI
AC
10
SYJ
AC
11
XYK
AD
12
XYL
AD
13
XYM
AE

 
SELECT AVG(EC.Num
FROM EC
WHERE(DeptName, Num) IN
          (SELECTED DeptName, COUNT(EmpId)AS
                                                    EC(DeptName, Num)
           FROM EMP
           GROUP BY DeptName)
 
The output of executing the SQL query is _________.
  • Your Answer:
Go to Question: