SQL Fundamentals - Practice 02
SQL Fundamentals - Practice 02
2. Create a report that displays the last name and department number for employee number
176.
5. Display the last name and department number of all employees in departments 20 or 50 in
ascending alphabetical order by name.
6. Modify lab_02_03.sql to display the last name and salary of employees who earn
between $5,000 and $12,000 and are in department 20 or 50. Label the columns
Employee and Monthly Salary, respectively. Resave lab_02_03.sql as
lab_02_06.sql. Run the statement in lab_02_06.sql.
8. Create a report to display the last name and job title of all employees who do not have a
manager.
9. Create a report to display the last name, salary, and commission of all employees who earn
commissions. Sort data in descending order of salary and commissions.
10. Members of the HR department want to have more flexibility with the queries that you are
writing. They would like a report that displays the last name and salary of employees who
earn more than an amount that the user specifies after a prompt. (You can use the query
that you created in practice exercise 1 and modify it.) Save this query to a file named
lab_02_10.sql. If you enter 12000 when prompted, the report displays the following
results:
13. Display the last names of all employees who have both an a and an e in their last name.
15. Modify lab_02_06.sql to display the last name, salary, and commission for all
employees whose commission amount is 20%. Resave lab_02_06.sql as
lab_02_15.sql. Rerun the statement in lab_02_15.sql.