Data Analyst Interview Resources: post #2399 โ€” TG.ME

๐Ÿ”ฅ SQL Interview Question of the Day

๐Ÿ“Œ Scenario:

An organization wants to find employees who earn more than their managers.

You have one table:

employees

โ€ข employee_id
โ€ข employee_name
โ€ข salary
โ€ข manager_id

โ˜‘ Solution:

SELECT
e.employee_name,
e.salary,
m.employee_name AS manager_name,
m.salary AS manager_salary
FROM employees e
JOIN employees m
ON e.manager_id = m.employee_id
WHERE e.salary > m.salary;

๐Ÿ’ก Concept Tested:

SELF JOIN

โค๏ธ React if you want more SQL interview questions.
โค1
August 31, 2026 91