Databases · Junior · Question 27 of 75

What does this query return?

SELECT city, COUNT(*)
FROM users
GROUP BY city;

Explanation

GROUP BY collapses rows with the same value into one, and aggregate functions are computed for each group.

Further reading

Problem with a question

Databases · Junior · question 27

Test yourself

Take the Databases · Junior quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz