0% found this document useful (0 votes)
9 views

SQL Practice Workbook 4

Uploaded by

praveens.ece2022
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)
9 views

SQL Practice Workbook 4

Uploaded by

praveens.ece2022
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/ 3

DATE: 27-05-2025

PRACTICE QUERIES: (BASED ON THE PREVIOUS TABLE EXERCISES)

1. Retrieve all columns from the Employees table.

2. Show only the Name and Salary of each employee.

3. Display the Department of each employee.

4. List all unique departments in the Employees table.

5. Find all employees who work in the 'IT' department.

6. Retrieve employees whose salary is more than 50000.

7. Get employees hired before January 1, 2022.

8. Show all employees who have the letter 'e' in their name.

9. Find employees whose names start with 'S'.

10. Find employees whose names end with 'n'.

11. List employees whose names contain the letter 'a'.

12. Show employees not in the 'HR' department.

13. Get employees whose salary is less than 60000.

14. Find employees with salary equal to 70000.

15. Retrieve employees hired in the year 2023.

16. Find employees from the 'Marketing' department.

17. Get employees with salary between 55000 and 65000.

18. Show employees hired after 2020 and before 2023.

19. Find employees whose name is exactly 'John'.

20. List employees who are not in the 'Finance' department.

21. Show employee names sorted alphabetically.


22. Sort employees by salary in ascending order.

23. Sort employees by hire date, newest first.

24. Show the top 5 highest paid employees.

25. List the first 5 employees alphabetically.

26. Count the total number of employees.

27. Find the average salary of all employees.

28. Get the highest salary from the Employees table.

29. Find the lowest salary among all employees.

30. Count the number of employees in the 'Sales' department.

31. Show employee name and salary, labeling salary as Income.

32. Display all employees and rename HireDate as JoiningDate.

33. Show Name and Department with Department labeled as Team.

34. List Name, Salary as MonthlyIncome, and HireDate.

35. Display the full Employees table with EmployeeID as ID.

36. List employees in the 'IT' or 'HR' department.

37. Find employees not in the 'IT' or 'Finance' departments.

38. Get employees whose name contains 'an'.

39. Retrieve employees whose salary is between 40000 and 80000.

40. Find employees with names like 'A%'.

41. Find employees with a non-null salary.

42. List employees with missing department data (if any).

43. Show all employees where salary is not null.


44. Get employees whose hire date is null (if any).

45. Find employees whose department is either 'Sales' or 'HR'.

46. Retrieve employees with their department name (using JOIN).

47. Show all departments from the Departments table.

48. Count how many departments are listed in the Departments table.

49. Display distinct department names from the Departments table.

50. Show DepartmentName and Location from the Departments table.

You might also like