0% found this document useful (0 votes)
145 views1 page

Exercise 4 More Functions

This document provides examples of writing SQL queries to: 1) Display employee names and hire dates from department 20 in a formatted output 2) Display employee names, hire dates, and calculated salary review dates ordered by review date 3) Print employee salaries and indicate if they are above, on, or below a target amount 4) Return the day of the week for any entered date in DD.MM.YY format

Uploaded by

sitinursyukrina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
145 views1 page

Exercise 4 More Functions

This document provides examples of writing SQL queries to: 1) Display employee names and hire dates from department 20 in a formatted output 2) Display employee names, hire dates, and calculated salary review dates ordered by review date 3) Print employee salaries and indicate if they are above, on, or below a target amount 4) Return the day of the week for any entered date in DD.MM.YY format

Uploaded by

sitinursyukrina
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

Exercise 4: More Functions

1. Display each employee's name and hiredate from deptno 20. Make sure that you specify the
alias 'DATE_HIRED' after your expression otherwise the formatted column will wrap; it uses a
width of 80 characters which is the default for character columns.

ENAME DATE_HIRED
---------- --------------------------------
SMITH June, Thirteenth 1983
JONES October, Thirty-First 1983
SCOTT March, Fifth 1984
ADAMS June, Fourth 1984
FORD December, Fifth 1983

2. Display each employee name with hiredate, and salary review date. Assume review date is one
year after hiredate. Order the output in ascending review date order.

3. Print a list of employees displaying just salary if more than 1500. If exactly 1500 display 'On
Target', if less than 1500 display 'Below 1500'.

4. Write a query which will return the DAY of the week (ie. MONDAY), for any date entered in the
format: DD.MM.YY.

Enter value for any date: 12.11.88

DAY
------------------------------------------------------
SATURDAY

You might also like