Databases · Junior · Question 27 of 75
What does this query return?
SELECT city, COUNT(*)
FROM users
GROUP BY city;- 1Every user with their city
- ✓Correct answer: One row per city with the number of users in it
- 3The total number of users
Explanation
GROUP BY collapses rows with the same value into one, and aggregate functions are computed for each group.