0% found this document useful (0 votes)
3 views1 page

SQL Practice

The document contains a set of practice questions focused on SQL queries related to an Employees table. It includes tasks such as retrieving records, counting employees, filtering by salary, and joining with other tables. The questions cover various SQL operations including selection, aggregation, and relationships between tables.

Uploaded by

anjali.ibmce
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)
3 views1 page

SQL Practice

The document contains a set of practice questions focused on SQL queries related to an Employees table. It includes tasks such as retrieving records, counting employees, filtering by salary, and joining with other tables. The questions cover various SQL operations including selection, aggregation, and relationships between tables.

Uploaded by

anjali.ibmce
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

Practice Questions

1. Retrieve all records from a table named Employees.


2. Get the distinct departments from the Employees table.
3. Count the total number of employees in the Employees table.
4. Retrieve all employees whose salary is greater than 50,000.
5. List names of employees whose name starts with 'A'.
6. Fetch the top 5 highest-paid employees.
7. Retrieve employees who do not have a manager (i.e., NULL in manager_id).
8. Show all columns from Employees where hire_date is in 2024.
9. Fetch records where department_id is either 10, 20, or 30.
10. Get the total salary paid to all employees.
11. Fetch employee names along with their department names (use Employees and
Departments tables).
12. List all employees and their manager names.
13. Show employees who work in the same department as 'John'.
14. Get a list of employees and their project names using a many-to-many relationship
(via EmployeeProjects table).
15. Write a query to display employees with no assigned project.

You might also like