Given two tables $EMPLOYEE(EID,ENAME,DEPTNO)$ and $DEPARTMENT(DEPTNO,DEPTNAME)$.
Find the most appropriate statement of the given query:
Select count(*) 'total'
from EMPLOYEE
where DEPTNO IN (D1, D2)
group by DEPTNO
having count(*) > 5;
The query first selects employees whose department number is either $D1$ or $D2$.
Then,
$group\ by\ DEPTNO$
means employees are grouped department-wise.
After that,
$having\ count(*)>5$
means only those department groups will be displayed whose employee count is greater than $5$.
So, the query displays the total number of employees of departments $D1$ and $D2$ only if their count is greater than $5$.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.
Online Test Series, Information About Examination,
Syllabus, Notification
and More.