Databases · Junior · Question 71 of 75

How do you get the 5 cities with the most users?

Explanation

Group, count, sort by the count and limit. ORDER BY can use the alias n because it runs after SELECT.

Further reading

Problem with a question

Databases · Junior · question 71

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