SQL Fundamentals - Practice 03
SQL Fundamentals - Practice 03
Part 1
1. Write a query to display the current date. Label the column Date.
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.
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.
Rewrite the query so that the user is prompted to enter a letter that starts the last name. For
example, if the user enters H when prompted for a letter, then the output should show all
employees whose last name starts with the letter H.
10. Display the last name, hire date, and day of the week on which the employee started. Label
the column DAY. Order the results by the day of the week, starting with Monday.
12. Create a query that displays the first eight characters of the employees’ last names and
indicates the amounts of their salaries with asterisks. Each asterisk signifies a thousand
dollars. Sort the data in descending order of salary. Label the column
EMPLOYEES_AND_THEIR_SALARIES.
14. Rewrite the statement in the preceding exercise using the CASE syntax.
Oracle Database 10g: SQL Fundamentals I 3 - 68