πŸ“Š MySQL
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
  • (A) Filter out all rows whose total emp_id below 2
  • (B) -ln
  • (C) Filter out all rows whose total emp_id below 2 & Selecting those rows whose total emp_id>2
  • (D) None of the mentioned
πŸ’¬ Discuss
βœ… 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:

Explanation by: Ritu Singhal
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:

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
85
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Ritu Singhal
Publisher
πŸ“ˆ
95%
Success Rate