SECTION 1 LESSON 2
1. Display Oracle database employee last_name and salary for employee_ids between 100 and 102. Include a third column that divides each salary by 1.55 and rounds the result to two decimal places.
where employee_id between 100 and 102;
2. Display employee last_name and salary for those employees who work in department 80. Give each of them a raise of 5.33% and truncate the result to two decimal places.
3. Use a MOD number function to determine whether 38873 is an even number or an odd number.
(the remainder is 1, so 38873 is an odd number.)
4. Use the DUAL table to process the following numbers:
845.553 - round to one decimal place
30695.348 - round to two decimal places
30695.348 - round to -2 decimal places
2.3454 - truncate the 454 from the decimal place
5. Divide each employee's salary by 3. Display only those employees?last names and salaries who earn a salary that is a multiple of 3.
----select last_name,salary ,mod(salary,3)
6. Divide 34 by 8. Show only the remainder of the division. Name the output as EXAMPLE.
7. How would you like your paycheck -- rounded or truncated? What if your paycheck was calculated to be $565.784 for the week, but you noticed that it was issued for $565.78. The loss of .004 cent would probably make very little difference to you. However, what if this was done to a thousand people, a 100,000 people, or a million people! Would it make a difference then? How much difference?
----I would like my paycheck to be rounded,haha.