Skip to main content
SQL • LESSON 110

CASE with Department

How can we assign business categories to departments?

Advanced3 Minutes1230 XP
🤔 THE QUESTION

How can we assign business categories to departments?

💡 WHAT IS IT?

CASE maps multiple granular department values into higher-level business groupings.

🎯 WHAT IS IT USED FOR?

Consolidating departments into divisions (Technology, Operations, Business), taxonomy mapping.

💻 EXAMPLE
SELECT
name,
department,
CASE
    WHEN department = 'Engineering' THEN 'Technology'
    WHEN department = 'Analytics' THEN 'Technology'
    ELSE 'Business'
END AS department_group
FROM employees;

🎯 Mission Objectives

Practice typing production-grade SQL code for CASE with Department.

  • Categorical mapping
  • Department groupings
  • Taxonomy classification
  • CASE logic