πŸ“Š MySQL
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
πŸ’¬ Discuss
βœ… Correct Answer: (B) Aggregation of the field "name" of table "department"

Explanation: 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".

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".

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
105
Total Visits
πŸ“½οΈ
1 y ago
Published
πŸŽ–οΈ
Bhagwan Das
Publisher
πŸ“ˆ
91%
Success Rate