SQL Task list
SQL Task list
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.
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.
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.
Assignment-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.
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.
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.
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.
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
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=5) highest salary from a table.
Assignment-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.