Q. What is the significance of the statement "HAVING COUNT (emp_id)>2" in the following MySQL statement?
SELECT d.name, COUNT (emp_id) emp_no
FROM department d INNER JOIN Employee e
ON d.dept_id=e.emp_id
GROUP BY d.name
HAVING COUNT (emp_id)>2
SELECT d.name, COUNT (emp_id) emp_no
FROM department d INNER JOIN Employee e
ON d.dept_id=e.emp_id
GROUP BY d.name
HAVING COUNT (emp_id)>2
β
Correct Answer: (C)
Filter out all rows whose total emp_id below 2 & Selecting those rows whose total emp_id>2
Explanation: This MySQL statement is designed to count employees in each department and display the department name and the number of employees. Let's break it down: