SQL Assignment

Akash Deep Nov 15 2021 · 3 min read
Share this

SQL Assignment_1

Q-1. Write an SQL query to fetch “FIRST_NAME” from Worker table using the alias name as <WORKER_NAME>.

Q-2. Write an SQL query to fetch unique values of DEPARTMENT from Worker table.

Q-3. Write an SQL query to show the last 5 record from a table.

SQL Assignment_2

Q-1. Write an SQL query to print the first three characters of  FIRST_NAME from Worker table.

Q-2. Write an SQL query to find the position of the alphabet (‘a’) in the first name column ‘Amitabh’ from Worker table.

Q-3. Write an SQL query to print the name of employees having the highest salary in each department.

SQL Assignment_3

Q-1. Write an SQL query to print the FIRST_NAME from Worker table after removing white spaces from the right side.

Q-2. Write an SQL query that fetches the unique values of DEPARTMENT from Worker table and prints its length.

Q-3. Write an SQL query to fetch nth max salaries from a table.

SQLAssignment_4

Q-1. Write an SQL query to print the FIRST_NAME from Worker table after replacing ‘a’ with ‘A’.

Q-2. Write an SQL query to print all Worker details from the Worker table order by FIRST_NAME Ascending and DEPARTMENT Descending.

Q-3. Write an SQL query to fetch the names of workers who earn the highest salary.

SQL Assignment_5

Q-1. Write an SQL query to print details of workers excluding first names, “Vipul” and “Satish” from Worker table.

Q-2. Write an SQL query to print details of the Workers whose FIRST_NAME ends with ‘h’ and contains six alphabets.

Q-3. Write a query to validate Email of Employee.

SQL Assignment_6  

Q-1. Write an SQL query to print details of the Workers who have joined in Feb’2014.

Q-2. Write an SQL query to fetch duplicate records having matching data in some fields of a table.

Q-3. How to remove duplicate rows from worker table.

SQL Assignment_7

Q-13. Write an SQL query to show only odd rows from a table.

Q-14. Write an SQL query to clone a new table from another table.

SQL Assignment_8

Q-15. Write an SQL query to fetch intersecting records of two tables.

Q-16. Write an SQL query to show records from one table that another table does not have.

SQL Assignment_9

Q-17. Write an SQL query to show the top n (say 10) records of a table.

Q-18. Write an SQL query to determine the nth (say n=10) highest salary from a table.

SELECT * FROM Worker ORDER BY Salary DESC LIMIT 10;

OR

select top 10 * from worker;

SQLAssignment_10

Q-19. Write an SQL query to determine the 5th highest salary without using TOP or limit method.

Q-20. Write an SQL query to fetch the list of employees with the same salary.

* * *

GitHub Link

https://github.com/akashdeep364/SQL-Assignment

Comments
Read next