The document contains the schema and sample data for three database tables: Worker, Bonus, and Title. The Worker table stores employee data, the Bonus table stores employee bonuses, and the Title table stores employee job titles and their effective dates. It also provides 23 questions to write SQL queries against the tables to return requested data fields, filter on conditions, perform aggregations and sorting.
The document contains the schema and sample data for three database tables: Worker, Bonus, and Title. The Worker table stores employee data, the Bonus table stores employee bonuses, and the Title table stores employee job titles and their effective dates. It also provides 23 questions to write SQL queries against the tables to return requested data fields, filter on conditions, perform aggregations and sorting.
The document contains the schema and sample data for three database tables: Worker, Bonus, and Title. The Worker table stores employee data, the Bonus table stores employee bonuses, and the Title table stores employee job titles and their effective dates. It also provides 23 questions to write SQL queries against the tables to return requested data fields, filter on conditions, perform aggregations and sorting.
The document contains the schema and sample data for three database tables: Worker, Bonus, and Title. The Worker table stores employee data, the Bonus table stores employee bonuses, and the Title table stores employee job titles and their effective dates. It also provides 23 questions to write SQL queries against the tables to return requested data fields, filter on conditions, perform aggregations and sorting.
(WORKER_REF_ID, WORKER_TITLE, AFFECTED_FROM) VALUES (001, 'Manager', '2016-02-20 00:00:00'), (002, 'Executive', '2016-06-11 00:00:00'), (008, 'Executive', '2016-06-11 00:00:00'), (005, 'Manager', '2016-06-11 00:00:00'), (004, 'Asst. Manager', '2016-06-11 00:00:00'), (007, 'Executive', '2016-06-11 00:00:00'), (006, 'Lead', '2016-06-11 00:00:00'), (003, 'Lead', '2016-06-11 00:00:00'); What would be the result when these queries will be executed: Use the above tables to solve the following queries: 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 fetch unique values of DEPARTMENT from Worker table. 4. Write an SQL query to print the first three characters of FIRST_NAME from Worker table. 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 from Worker table after replacing ‘a’ with ‘A’. 7. 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. 8. Write an SQL query to print all Worker details from the Worker table order by FIRST_NAME Ascending. 9. Write an SQL query to print all Worker details from the Worker table order by FIRST_NAME Ascending and DEPARTMENT Descending. 10. Write an SQL query to print details for Workers with the first name as “Mon” and “Aon” from Worker table. 11. Write an SQL query to print details of Workers with DEPARTMENT name as “Admin”. 12. Write an SQL query to print details of the Workers whose FIRST_NAME ends with ‘a’. 13. Write an SQL query to print details of the Workers whose SALARY lies between 100000 and 500000. 14. Write an SQL query to print details of the Workers who have joined in Feb’2014. 15. Write an SQL query to fetch the count of employees working in the department ‘Admin’. 16. Write an SQL query to fetch the no. of workers for each department in the descending order. 17. Write an SQL query to fetch duplicate records having matching data in some fields of a table. 18. Write an SQL query to fetch intersecting records of two tables. 19. Write an SQL query to show records from one table that another table does not have. 20. Write an SQL query to show the current date and time. 21. Write an SQL query to fetch the departments that have less than five people in it. 22. Write an SQL query to show all departments along with the number of people in there. 23. Write an SQL query to fetch departments along with the total salaries paid for each of them.