B

Bhagwan Das • 4.44K Points
Extraordinary

Q. What is the significance of the statement "GROUP BY d.name" 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

  • (A) Aggregation of the field "name" of both table
  • (B) Aggregation of the field "name" of table "department"
  • (C) Sorting of the field "name"
  • (D) None of the mentioned

Explanation by: Bhagwan Das
This SQL statement is designed to count the number of employees in each department. The key part you are asking about is "GROUP BY d.name".

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.