A database table is defined as employees(id, name, dept). Which of the following SQL queries correctly returns the number of employees in each department?
SELECT dept, COUNT(*) FROM employees GROUP BY dept;
SELECT dept, COUNT(*) FROM employees;
SELECT COUNT(*) FROM employees WHERE dept;
SELECT dept, SUM(id) FROM employees GROUP BY dept;
The verified answer and full solution are one login away
Every answer here is machine verified, with a step-by-step solution that teaches the method. Your login also unlocks a 7-question mock preview in the real exam interface.
Log in to see the answerMore sql questions