Repaso
EspaƱol

What does SELECT DISTINCT country FROM users; return?

Options

  1. Every row's country, duplicates included
  2. Each country only once (Correct option)
  3. The number of countries
  4. The first country

Answer

Each country only once

Why

DISTINCT removes duplicate rows from the result. If 100 users are from Peru, 'Peru' appears once.

To count the different values: SELECT COUNT(DISTINCT country) FROM users;.

Remember

DISTINCT = unique values only.

Key terms

Practice this question in Repaso