Resave your sql statement to a file named p2q3sql

This preview shows page 4 - 7 out of 47 pages.

Resave your SQL statement to a file named p2q3.sql. Rerun your query.
7. Display the name and hire date of every employee who was hired in 1982.
8. Display the name and job title of all employees who do not have a manager.
9. Display the name, salary and commission for all employees who earn commissions. Sort data in descending order of salary and commissions.
10. Display the name of all employees where the third letter of their name is an A.
11. Display the name of all employees who have two L’s in their name and are in department 30 or their manager is 7782.
AND deptno = 30 OR mgr = 7782 If you want extra challenge, complete the following exercises: 12. Display the name, job, and salary for all employees whose job is Clerk or Analyst and their salary is not equal to $1000, $3000, or $5000.
13. Modify p2q6.sql to display the name, salary, and commission for all employees whose commission amount is greater than their salary increased by 10%. Rerun your query. Resave your query as p2q13.sql.
Practice 3 Answers 1. Write a query to display the current date. Label the column Date.
2. Display the employee number, name, salary, and salary increase by 15% expressed as a whole number. Label the column New Salary. Save your SQL statement to a file named p3q2.sql.
3. Run your query in the file p3q2.sql.
4. Modify your query p3q2.sql to add a column that will subtract the old salary from the new salary. Label the column Increase. Rerun your query.
5. Display the employee’s name, hire date, and salary review date, which is the first Monday after six months of service. Label the column REVIEW. Format the dates to appear in the format similar to “Sunday, the Seventh of September,1981.”
6. For each employee display the employee name and calculate the number of months between today and the date the employee was hired. Label the column MONTHS_WORKED. Order your results by the number of months employed. Round the number of months up to the closest whole number.

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture