We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3
SQL ASSEMENT
Create the following tables :-
1. Write an SQL query to fetch “FIRST_NAME” from Worker table using the alias name as <WORKER_NAME>. 2. Write an SQL query to fetch “FIRST_NAME” from Worker table in upper case. 3. Write an SQL query to print the first three characters of FIRST_NAME from Worker table. 4. Write an SQL query to print the FIRST_NAME from Worker table after removing white spaces from the right side. 5. Write an SQL query that fetches the unique values of DEPARTMENT from Worker table and prints its length. 6. Write an SQL query to print the FIRST_NAME and LAST_NAME from Worker table into a single column COMPLETE_NAME. A space char should separate them. 7. Write an SQL query to print all Worker details from the Worker table order by FIRST_NAME Ascending and DEPARTMENT Descending. 8. Write an SQL query to print details for Workers with the first name as “Vipul” and “Satish” from Worker table. 9. Write an SQL query to print details of the Workers whose SALARY lies between 100000 and 500000. 10. Write an SQL query to print details of the Workers who have joined in Feb’2014. 11. Write an SQL query to fetch the count of employees working in the department ‘Admin’. 12. Write an SQL query to print details of the Workers who are also Managers. 13. Write an SQL query to show only odd rows from a table. 14. Write an SQL query to show the current date and time. 15. Write an SQL query to fetch the first row of a table. 16. Write an SQL query to show all departments along with the number of people in there. 17. Write an SQL query to fetch the last five records from a table. 18. Write an SQL query to print the name of employees having the highest salary in each department. 19. Write an SQL query to show the last record from a table. 20. Write an SQL query to fetch the names of workers who earn the highest salary.