---
title: "Count Employees - SQL Interview Query 13 | SQL Problem Level \"EASY\""
url: https://daily.dev/posts/count-employees---sql-interview-query-13-sql-problem-level-easy--fajwlmkqb
source_url: https://www.youtube.com/watch?v=78DNY36XxQw
type: video:youtube
source: "techTFQ"
published: 2026-05-31T07:43:11.944Z
updated: 2026-05-31T07:54:10.804Z
tags: ["sql", "postgresql"]
reading_time: 6
upvotes: 0
comments: 0
language: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# Count Employees - SQL Interview Query 13 | SQL Problem Level "EASY"

**[techTFQ](https://daily.dev/sources/techtfq)** · 6 min read · 0 upvotes · 0 comments

## Summary

A walkthrough of an SQL interview problem that requires counting the number of employees managed by each manager. The solution uses a self join on an employee table, joining the manager_id column back to the id column of the same table to resolve manager names, then groups by manager and counts employees. The tutorial covers why self joins are the natural fit for hierarchical employee-manager relationships and how to handle NULL managers using inner vs left joins.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://www.youtube.com/watch?v=78DNY36XxQw>

---

Tags: [#sql](https://daily.dev/tags/sql), [#postgresql](https://daily.dev/tags/postgresql)

[View this post on daily.dev](https://daily.dev/posts/count-employees---sql-interview-query-13-sql-problem-level-easy--fajwlmkqb)
