[go: up one dir, main page]

0% found this document useful (0 votes)
15 views4 pages

60 Questions

Uploaded by

lokianp99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views4 pages

60 Questions

Uploaded by

lokianp99
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

To generate 60 similar questions, I'll group them by complexity and relevance to

database systems and SQL. Here's how I'll structure the levels:

1. Easy: Questions requiring basic SQL operations (e.g., SELECT, COUNT, SUM).

2. Medium: Questions involving conditions, grouping (GROUP BY), and joins.

3. Hard: Questions involving subqueries, advanced conditions, or calculations.

Easy Level Questions

1. Write a query to display the first names of all employees.

2. Write a query to count how many employees are in the company.

3. Write a query to find all employees hired after the year 2020.

4. Write a query to display all unique department names.

5. Write a query to calculate the total salary of employees with a salary less than
10,000.

6. Write a query to find employees who do not belong to any department.

7. Write a query to retrieve the names of employees working in the Sales


department.

8. Retrieve the names of all employees along with their salaries.

9. Write a query to calculate the total number of employees in the IT department.

10. Write a query to find the last names of employees whose first names start with
"A".

Medium Level Questions

1. Write a query to find the average salary of employees whose salary is greater
than 8,000.

2. Retrieve the names and departments of employees whose salaries are between
10,000 and 20,000.

3. Write a query to find employees who are either in the IT or Engineering


department.

4. Retrieve the names of employees who have the same salary as the highest-paid
employee in the Sales department.
5. List the departments with fewer than 5 employees.

6. Write a query to retrieve the total salary paid to employees supervised by a


specific manager.

7. Write a query to list employees with a salary greater than the department average
salary.

8. Find the name and department of the employee with the second-highest salary.

9. List employees who were hired in the last 6 months.

10. Write a query to retrieve employees who share the same last name.

Hard Level Questions

1. Write a query to calculate the difference between the average salary of


employees in IT and Engineering departments.

2. Retrieve the names of employees who earn more than the average salary of their
respective departments.

3. Write a query to display departments where the total salary is less than 50,000.

4. Write a query to list employees who have been with the company for more than 5
years.

5. Write a query to calculate the total salary of employees who do not report to any
manager.

6. Retrieve the names of employees and their managers. Include employees


without managers.

7. Write a query to list employees who work in the same department as their
managers.

8. Find the departments with the highest and lowest average salaries.

9. Retrieve all department names along with the total and average salaries in those
departments.

10. Write a query to find employees who have never been assigned to a project.

Advanced SQL Questions

1. Write a query to retrieve the names of employees who earn more than any
employee in the Sales department.
2. Write a query to find employees whose salary is in the top 10% of the company.

3. Write a query to retrieve employees who do not belong to any department but are
supervised by a manager.

4. Find the employees who have the same job title as the employee earning the
highest salary in the company.

5. Write a query to list departments with total salaries exceeding the company-
wide average salary.

6. Write a query to retrieve employees whose salaries are below the average salary
for their job title.

7. Retrieve the names of employees and their supervisors, ensuring supervisors’


names appear even if they supervise no one.

8. Write a query to calculate the cumulative salary expense per department.

9. Retrieve the names of employees hired in the same month as the employee with
the maximum salary.

10. Write a query to find all employees who have not received a salary update in the
last two years.

11. Retrieve departments that employ at least one employee earning above 15,000
but have an average salary below 10,000.

12. Write a query to calculate the total salary for each supervisor, considering all
employees they supervise.

13. Retrieve the names of employees who work in departments that employ more
than 5% of the total workforce.

14. Write a query to display departments where the highest-paid employee's salary
is less than 20,000.

15. Retrieve all departments and their total employee counts, including departments
without employees.

16. Write a query to calculate the median salary across all employees in the
company.

17. Find employees who report directly or indirectly to the same manager.

18. Write a query to list employees who were hired before the earliest hire date in the
Sales department.

19. Retrieve the names of employees who are in the top 5% of earners in their
respective departments.
20. Write a query to list employees whose salary is a prime number.

21. Retrieve the names of employees working on the maximum number of projects
within the company.

22. Write a query to find employees whose salary is above the 75th percentile for
their department.

23. Retrieve the total number of employees in each department, including empty
departments, sorted in descending order of the count.

24. Write a query to calculate the standard deviation of salaries in the Engineering
department.

25. Retrieve the names of employees who work in departments where every
employee earns more than 10,000.

26. Write a query to find employees who have the same hire date as their
supervisors.

27. Retrieve all employees who have worked in more than one department during
their tenure.

28. Write a query to identify employees whose total salary exceeds the sum of
salaries in their department (use subqueries).

29. Find the percentage of employees in each department who earn above the
department’s average salary.

30. Write a query to list all employees along with their rank in the company based on
salary (e.g., using RANK() or DENSE_RANK()).

You might also like