🚀 Welcome to **DataEngineers Academy**!
In this video, you'll learn how to solve the popular *Manager Reports Count & Average Age SQL Interview Question* using *Self JOIN, COUNT(), AVG(), and GROUP BY* with a complete step-by-step explanation.
This SQL problem is commonly asked in Data Engineer, Data Analyst, SQL Developer, and BI Developer interviews. You'll learn how to analyze employee-manager relationships, find the number of direct reports under each manager, and calculate the average age of their team members.
The complete solution is explained using **Snowflake SQL**, helping you understand hierarchical data analysis and self-referencing table relationships used in real-world projects.
🔥 *What You'll Learn*
✅ Self JOIN explained with examples
✅ Employee-manager hierarchy analysis
✅ COUNT() function for report calculation
✅ AVG() function for average age
✅ GROUP BY with manager data
✅ Handling hierarchical relationships
✅ SQL interview problem-solving approach
✅ Snowflake SQL implementation
✅ Real-world HR analytics use case
━━━━━━━━━━━━━━━━━━━━━━━
🧑💻 *Snowflake DDL*
```sql id="q8m4vz"
CREATE OR REPLACE TABLE Employee (
employee_id INT,
employee_name STRING,
manager_id INT,
age INT
);
```
━━━━━━━━━━━━━━━━━━━━━━━
🧑💻 *Snowflake DML*
```sql id="r5n9kp"
INSERT INTO Employee VALUES
(1,'John',NULL,45),
(2,'Alice',1,30),
(3,'Bob',1,35),
(4,'Charlie',2,28),
(5,'David',2,32),
(6,'Emma',3,25);
```
━━━━━━━━━━━━━━━━━━━━━━━
🧑💻 *SQL Solution*
```sql id="v7x2ms"
SELECT
m.employee_id AS manager_id,
m.employee_name AS manager_name,
COUNT(e.employee_id) AS reports_count,
ROUND(AVG(e.age),2) AS average_age
FROM Employee m
JOIN Employee e
ON m.employee_id = e.manager_id
GROUP BY
m.employee_id,
m.employee_name;
```
━━━━━━━━━━━━━━━━━━━━━━━
📚 *Concepts Covered*
• Self JOIN
• Employee Hierarchy
• COUNT() Aggregate Function
• AVG() Function
• GROUP BY
• ROUND() Function
• SQL Interview Questions
• Snowflake SQL
• Hierarchical Data Queries
• HR Analytics SQL
━━━━━━━━━━━━━━━━━━━━━━━
🎯 *Perfect For*
✔ Data Engineers
✔ Data Analysts
✔ SQL Developers
✔ BI Developers
✔ ETL Developers
✔ Snowflake Developers
✔ Database Administrators
✔ SQL Freshers preparing for interviews
✔ Anyone learning Advanced SQL
━━━━━━━━━━━━━━━━━━━━━━━
💡 *Why This Question Matters*
The *Manager Reports Count & Average Age* SQL problem tests your ability to work with hierarchical relationships stored in a single table. Self JOIN is a powerful SQL technique used for employee-manager structures, category trees, organization charts, and relationship-based datasets.
Understanding Self JOIN, aggregation, and grouping logic will help you solve many real-world SQL interview questions confidently.
👍 *If this video helped you:*
✅ Like this video
✅ Subscribe to *DataEngineers Academy*
✅ Share with your friends and colleagues
✅ Turn on the notification bell
✅ Comment your SQL approach
At **DataEngineers Academy**, you'll learn SQL Interview Questions, Snowflake SQL Tutorials, Data Engineering Concepts, ETL Tutorials, Window Functions, CTEs, Joins, Stored Procedures, and Real-World SQL Projects to help you become a confident Data Engineer.
#SQL #SQLInterviewQuestions #Snowflake #SnowflakeSQL #SelfJoin #GroupBy #Count #AVG #DataEngineer #DataEngineering #SQLTutorial #LeetCodeSQL #Database #ETL #DataAnalytics #LearnSQL #InterviewPreparation #SQLPractice #DataEngineersAcademy
On this page of the site you can watch the video online Snowflake SQL Interview Question: Manager Reports Count & Average Age | Self Join with a duration of hours minute second in good quality, which was uploaded by the user DataEngineers Academy 15 July 2026, share the link with friends and acquaintances, this video has already been watched 7 times on youtube and it was liked by 0 viewers. Enjoy your viewing!