All mock tests are FREE till 31 December — register to save your progress
Unit 4 · Database Management Systems Paper 2 CS · December 2019

Given two tables EMPLOYEE (EID, ENAME, DEPTNO) 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.

Pick an option to check yourself, or open the answer below.

Show answer & explanation

Correct answer: B. Total number of employees of departments D1 and D2 if their total is > 5.

Explanation

The query counts employees per department D1 and D2 and keeps only departments whose count exceeds 5.

More Database Management Systems questions