Week 2 Assignment Practice 3 - David Grof Practice 3 Part 1...

This preview shows page 1 - 3 out of 12 pages.

David Grof Practice 3 Part 1 1. Write a query to display the current date. Label the column Date. a. SELECT sysdate "Date" FROM dual; 2. The HR department needs a report to display the employee number, last_name, salary, and salary increased by 15.5% (expressed as a whole number) for each employee. Label the column New Salary. Place your SQL statement in a text file named lab_03_02.sql. a. SELECT employee_id, last_name, salary, ROUND (salary * 1.155, 0) "New Salary" FROM employees; 3.
4. Modify your query lab_03_02.sql to add a column that subtracts the old salary from the new salary. Label the column Increase. Save the contents of the file as lab_03_04.sql. Run the revised query.
5. Write a query that displays the last name (with the first letter uppercase and all other letters lowercase) and the length of the last name for all employees whose name starts with the letters J, A, or M. Give each column an appropriate label. Sort the results by the employees’ last names. a. SELECT INITCAP (last_name) "Name", LENGTH (last_name) "Length" FROM employees WHERE last_name LIKE 'J%' OR last_name LIKE 'M%' OR last_name LIKE 'A%' ORDER BY last_name ;

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture