SQL Interview Question of the Day 📌 Scenario: A company wants to… — Cloudydata — TG.ME

🔥 SQL Interview Question of the Day

📌 Scenario:

A company wants to identify employees who share the same salary with at least one other employee.

You have one table:

employees

• employee_id
• employee_name
• salary

Solution:

SELECT
employee_id,
employee_name,
salary
FROM employees
WHERE salary IN (
SELECT salary
FROM employees
GROUP BY salary
HAVING COUNT(*) > 1
);

💡 Concept Tested:

Subquery + GROUP BY + HAVING

❤️ React if you want more SQL interview questions.
❤5
September 1, 2026 135 2