lesphomework

this is a crazy site for crazy people

Saturday

section 3

select round('event_date','month'),months_between(sysdate,'event_date')
from dual

select (months_between(vacation_date,start_date)*30.5)as"Days"
from dual;

select (months_between('01-JAN-06','31-DEC-06')/12)*365
from dual;

select trunc(round(sysdate,'month'),'month')as alias,trunc(round(sysdate,'year'),'year')as alias
from dual;

select last_day('01-JUN-05')as aliasfrom dual;

select round(months_between(sysdate,birthday)/12,'year')
from dualwhere name='Bob Miller';

select add_months(sysdate,6) as"Appointment"
from dual;

select months_between('27-MAY-06','01-JAN-07')
from dual;

-select next_day('27-MAY-06','friday')as"First Friday"
from dual;

Friday

section 1 lesson 2

select last_name,salary,round(salary/1.55,2)
from employees
where employee_id between 100 and 102


select last_name,trunc(salary+salary*0.0533,2)
from employeeswhere department_id=80;

select mod(38873,2)
from dual;

select round(845.553,1)
from dual;

elect round(30695.348,2)
from dual;

select round(30695.348,-2)
from dual;

select trunc(2.3454,1)
from dual;


select last_name,salary
from employeeswhere mod(salary,3)=0


select mod(34,8)as"EXAMPLE"
from dual;

Tuesday

section 1 lesson 1

1.select concat(concat( 'Oracle',' Internet'),' Academy')
from dual


2.select substr ('Oracle Internet Academy',13,3) as "The Net"
from dual

3.SELECT LENGTH ('Oracle Internet Academy')
from DUAL

4.SELECT INSTR('Oracle Internet Academy', 'I')
from DUAL

5.SELECT lpad('Oracl',9,'*')rpad('e',5,'*')rpad('Internet',12,'*')rpad('Academy',12,'*')
from DUAl

6.SELECT 'Oracle'Lpad('Internet',11,'$')Lpad('Academy',10,'$')
from DUAl

7.select replace('Oracle Internet Academy','Internet','2004-2005')as "The best Class"
from dual

8.SELECT order_date,LPAD(order_total,7,'$') AS"TOTAL"
FROM F_ORDERS

9.SELECT CONCAT(FIRST_NAME, LAST_NAME)'_'ADDRESS ' 'CITY' 'STATE' 'ZIP
FROM F_CUSTOMERS
WHERE ID=456