Skip to main content
SQL • LESSON 56

DISTINCT

How can we retrieve each department only once?

Beginner3 Minutes690 XP
🤔 THE QUESTION

How can we retrieve each department only once?

💡 WHAT IS IT?

The DISTINCT keyword eliminates duplicate rows from the query output, returning only unique values.

🎯 WHAT IS IT USED FOR?

Extracting distinct category lists, deduplicating lookup codes, auditing unique entities.

💻 EXAMPLE
SELECT DISTINCT department
FROM employees;

🎯 Mission Objectives

Practice typing production-grade SQL code for DISTINCT.

  • DISTINCT keyword
  • Deduplication
  • Unique values
  • Column projection