MySQL Exercise
SECTION 2nd.
Restricting and Sorting data
So here is the second section of the exercise In this section, we are going to solve some little bit of difficult queries, So without further ado let's start the section. I have already given the HR database link in the previous section if you are new here then go to the previous section and download the HR demo database.
solve all the queries on your own, because practice makes perfect...
1. Write a query to display the name (first_name, last_name) and salary for all employees whose salary is not in the range $10,000 through $15,000.
2. Write a query to display the name (first_name, last_name) and department ID of all employees in departments 30 or 100 in ascending order.
3. Write a query to display the name (first_name, last_name) and salary for all employees whose salary is not in the range $10,000 through $15,000 and are in department 30 or 100.
4. Write a query to display the name (first_name, last_name) and hire date for all employees who were hired in 1987.
5. Write a query to display the first_name of all employees who have both "b" and "c" in their first names.
6. Write a query to display the last name, job, and salary for all employees whose job is that of a Programmer or a Shipping Clerk, and whose salary is not equal to $4,500, $10,000, or $15,000.
7. Write a query to display the last name of employees whose names have exactly 6 characters.
8. Write a query to display the last name of employees having 'e' as the third character.
9. Write a query to display the name (first_name, last_name), salary, and PF (15% of salary) of all employees.
10. Write a query to select all records from employees where the last name is 'BLAKE', 'SCOTT', 'KING', and 'FORD'.
11. Write a query to select all the employees whose first name is 5 characters long.
Do share and leave a Comment
Blog By Patel Aasif J. Khan
Comments
Post a Comment