Consider the Goldstar database. Choose the query that will display all of the position titles and the number of employees that hold that position.
SELECT title, COUNT(ssn) AS TotalEmployees FROM position, employee WHERE position.location_id = employee.position_id GROUP BY title;
SELECT title, SUM(ssn) AS TotalEmployees FROM position, employee WHERE position.position_id = employee.position_id GROUP BY title;
SELECT title, COUNT(ssn) AS TotalEmployees FROM position, employee WHERE position.position_id = employee.position_id GROUP BY title;
SELECT title, SUM(ssn) AS TotalEmployees FROM position, employee WHERE position.location_id = employee.position_id GROUP BY title;
The answer is:
SELECT title, COUNT(ssn) AS TotalEmployees FROM position, employee WHERE position.position_id = employee.position_id GROUP BY title;
Explanation:
Additional notes - The reasons other options were eliminated:
Let me know in the comments if anything is not clear. I will reply ASAP! Please do upvote if satisfied!
Get Answers For Free
Most questions answered within 1 hours.