Unique values with DISTINCT
SELECT DISTINCT removes duplicate rows from a result. It's the quickest way to see which values
a column contains:
SELECT DISTINCT category
FROM productsInside COUNT, DISTINCT counts the different values rather than the rows:
SELECT COUNT(DISTINCT customer_id) AS customers_who_ordered
FROM ordersMessy data shows up here
Try SELECT DISTINCT city FROM customers and look closely. You'll find Leeds, LEEDS and
leeds listed separately. To a database they're three different values. A distinct count is often
the first place you notice messy data, and Tier 2 shows how to tidy it.