DISTINCT Result
Predict Output Easy
Question
What does this SQL produce?
Code
-- employees: dept values IT, IT, HR, HR, Sales
SELECT DISTINCT dept FROM employees;
Hint
DISTINCT removes duplicate department values.
Explanation
SELECT DISTINCT dept returns each unique department once. The 5 rows have 3 unique departments: IT, HR, Sales. Result: 3 rows.
Related Resources
Related Lessons
- SELECT
Learn SELECT.
Look up unfamiliar terms
A beginner-friendly glossary explains jargon in plain English — variables, functions, DOM, Promise, and more.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.
Build real projects
Apply what you learned by building guided projects with starter code and solutions.