🟡 Easy (20 Questions)
1. Show all employees with their department names using INNER JOIN.
2. Show all employees with their department names using LEFT JOIN.
3. Show all departments with the employees working in them using RIGHT
JOIN.
4. Show all employees and all departments using FULL OUTER JOIN.
5. List all employees who have a department assigned (INNER JOIN).
6. List employees without a department (LEFT JOIN with WHERE
department_name IS NULL).
7. List all departments without employees (RIGHT JOIN with WHERE emp_id
IS NULL).
8. Show emp_id, emp_name, and department_name sorted by employee
name (INNER JOIN).
9. Show employees from the IT department (INNER JOIN with WHERE
department_name = 'IT').
10.List all employees in ascending order of department_id (LEFT JOIN).
11.List all departments in ascending order of department_id (RIGHT JOIN).
12.Show employees whose department_id is 103 (INNER JOIN).
13.Show all employees and their departments, if any (FULL OUTER JOIN).
14.List employees in the Finance department (INNER JOIN).
15.Show all departments starting with 'M' and their employees (RIGHT JOIN).
16.Show employees and departments where both IDs are the same (INNER
JOIN).
17.Show all employees and department names in descending salary order
(assume salary column exists) (INNER JOIN).
18.Show all employees and departments where department_id is not NULL
(INNER JOIN).
19.List employees who do not have matching department names (LEFT JOIN,
WHERE department_name IS NULL).
20.Show employees in departments IT or Finance (INNER JOIN).
🟡 Medium (20 Questions)
Join + filtering, grouping, aggregate functions.
21.Show the count of employees in each department (INNER JOIN + GROUP
BY).
22.Show the count of employees including those without a department (LEFT
JOIN + GROUP BY).
23.List departments with more than 2 employees (INNER JOIN + GROUP BY
+ HAVING).
24.Show all departments and the number of employees in them (RIGHT JOIN
+ GROUP BY).
25.Show all employees who work in departments with names ending in 'e'
(INNER JOIN).
26.Show employees joined after 2020 with their department names (INNER
JOIN).
27.Show the average salary of employees in each department (INNER JOIN).
28.Show the maximum salary in each department, including departments
without employees (LEFT JOIN).
29.Show the minimum salary for each department (INNER JOIN).
30.Show all employees whose department name contains 'a' (INNER JOIN +
LIKE).
31.List all employees and their departments, sorted by department name
(LEFT JOIN).
32.Show all departments with no employees (RIGHT JOIN + WHERE emp_id
IS NULL).
33.Show all employees without a department (LEFT JOIN + WHERE
department_name IS NULL).
34.Show all employees and their departments, replacing NULL department
names with 'No Department' (LEFT JOIN + COALESCE).
35.Show the department with the highest number of employees (INNER JOIN
+ GROUP BY + ORDER BY COUNT(*) DESC LIMIT 1).
36.Show the department with the lowest salary employee (INNER JOIN +
ORDER BY salary ASC LIMIT 1).
37.Show the average age of employees in each department (INNER JOIN).
38.Show employees who belong to departments with average salary > 60000
(INNER JOIN + HAVING).
39.Show employees working in a department but whose name does not
match exactly (INNER JOIN with mismatch criteria).
40.Show the number of employees per department, including 0 where no
employees (RIGHT JOIN).
🔴 Hard (20 Questions)
Complex joins, multiple joins, conditions, subqueries.
41.Show employees who do not belong to any department but still exist in
employees (LEFT JOIN).
42.Show departments with no employees and employees with no
departments (FULL OUTER JOIN).
43.Show employees in departments where the total salary exceeds 200000
(INNER JOIN + GROUP BY + HAVING).
44.List employees in the top 3 departments by employee count (INNER JOIN
+ GROUP BY + LIMIT).
45.Show employees in departments that have at least 1 employee earning
more than 80000 (INNER JOIN + EXISTS).
46.Show employees and departments where department name and employee
name start with the same letter (INNER JOIN).
47.Show employees who work in departments without repeating department
names (INNER JOIN + DISTINCT).
48.Show all employees, their departments, and also a column showing
whether they have a department assigned (LEFT JOIN + CASE).
49.Show all employees from employees table and match department name
with a second table of department heads (JOIN with 3 tables).
50.Show all employees whose department name length > 5 (INNER JOIN +
LENGTH).
51.Show employees in departments that have more than 5 employees with
salary above 50000 (INNER JOIN + nested GROUP BY).
52.Show employees in departments located in a certain city (JOIN with
location table).
53.Show employees who joined before the department was created (JOIN
with department creation date table).
54.Show employees without departments but with bonuses over 5000 (LEFT
JOIN).
55.Show employees whose departments have a null department name
(INNER JOIN).
56.Show all employees and departments, replacing missing names with
'Unknown' (FULL OUTER JOIN + COALESCE).
57.Show the highest paid employee in each department (INNER JOIN +
GROUP BY + MAX).
58.Show the department that has the least total salary (INNER JOIN +
GROUP BY + MIN).
59.Show employees and their departments, ordered first by department then
by salary (INNER JOIN).
60.Show employees in departments that have no manager assigned (JOIN
with managers table).