Coding question · Basic Filter AggEasyAsked at caseSQL

How many departments are there?

Warm-up. Practice the most basic aggregate — counting rows in a table.

Back to all coding questions

The Brief

HR AnalyticsPeople Ops team#coding-interview

Return the total number of departments at the company in a single row with a single column named `department_count`. Table: `ci_departments`.

Tables & columns available

ci_departmentsdim2 columns
ColumnTypeKey
idINTPK
nameTEXT

Hints (2)

Each hint you reveal reduces the XP you can earn. Try the query first.

Hint 1

COUNT(*) is your friend.

Hint 2

Alias the output column with AS department_count.