SELECT DISTINCT - Unique Values1 / 10
The DISTINCT keyword - as the name implies - returns only distinct or unique values from the specified column(s). View the inventory table below, and see what comes back when you type:
SELECT DISTINCT category FROM inventory;Table inventory
| item_id | product_name | category | size | color |
|---|---|---|---|---|
| 1 | T-Shirt | Clothing | M | Red |
| 2 | T-Shirt | Clothing | L | Blue |
| 3 | Jeans | Clothing | M | Blue |
| 4 | Hat | Accessories | One Size | Black |
| 5 | Sneakers | Footwear | 10 | White |
| 6 | Boots | Footwear | 11 | Black |
No key for < or > on your keyboard? Use these:
Ctrl+Enter to submit
SELECT DISTINCT - Unique Values - Free SQL Practice Online
Practise SELECT DISTINCT - Unique Values with 10 free, interactive SQL exercises. You type real queries into your browser and get instant feedback on every answer - no database setup, no install, and no signup. It is a fast, hands-on way to learn SQL online and build query skills you can use at work.