100%(3)3 out of 3 people found this document helpful
This preview shows page 1 - 4 out of 4 pages.
SELECT last_name, salary, ROUND(salary/1.55,2) "Calculated Salary"FROM employeesWHERE 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.333% and truncate the result to two decimal places. SELECT last_name, salary, TRUNC(salary*1.0533,2) "Raised Salary"FROM employeesWHERE department_id = 80;
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, salaryFROM employeesWHERE MOD(salary, 3) = 0;6.Divide 34 by 8. Show only the remainder of the division. Name the output as EXAMPLE. SELECT MOD(34, 8) as exampleFROM dual;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. Theloss of .004 cent would probably make very little difference to you. However, what if this was done to one thousand people, one hundred thousand people, or one million people! Would it make a difference then? How much of a difference? 1K: $4 , 100K : $400, 1000K (1 million) : $4000SELECT (565.784 - ROUND(565.784, 2))*1000*(:xx) as diffFROM dual;