Databases · Junior · Question 13 of 75

What does SELECT DISTINCT city FROM users return?

Explanation

To count unique values use COUNT(DISTINCT city). PostgreSQL also has DISTINCT ON (...) to keep the first row per group.

Further reading

Problem with a question

Databases · Junior · question 13

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