Documentos de Académico
Documentos de Profesional
Documentos de Cultura
select *
from (
select pi.product_name, max(oi.quantity)
from order_items oi, product_information pi
where oi.product_id= pi.product_id
group by pi.product_name
order by 2 desc
)
where rownum<=1
-- mas solicitado
select *
from (
select pi.product_name, count(oi.product_id)
from order_items oi, product_information pi
where oi.product_id= pi.product_id
group by pi.product_name
order by 2 desc
)
where rownum<=1
commit
commit
--INSERCION INCONDICIONAL
Create table historico_salario (Empid number,Hiredate date, Sal number);
select * from historico_salario
INSERT ALL
INTO historico_salario
VALUES(EMPID,HIREDATE,SAL)
INTO historico_sal_jefes
VALUES(EMPID,MGR,SAL)
SELECT employee_id EMPID, hire_date
HIREDATE, salary SAL, manager_id MGR
FROM employees
WHERE employee_id > 200;
INSERT ALL
WHEN SAL > 10000 THEN
INTO historico_salario
VALUES(EMPID,HIREDATE,SAL)
WHEN MGR > 200 THEN
INTO historico_sal_jefes
VALUES(EMPID,MGR,SAL)
SELECT employee_id EMPID,hire_date
HIREDATE,salary SAL, manager_id MGR
FROM employees
WHERE employee_id > 200;
INSERT FIRST
WHEN SAL > 25000 THEN
INTO salario_especial VALUES(DEPTID, SAL)
WHEN HIREDATE like ('%00%') THEN
INTO historico_fecha_inicial_00
VALUES(DEPTID,HIREDATE)
WHEN HIREDATE like ('%99%') THEN
INTO historico_fecha_inicial_99 VALUES(DEPTID,HIREDATE)
ELSE
INTO historico_fecha_inicial VALUES(DEPTID,
HIREDATE) SELECT department_id DEPTID, employee_id,salary SAL, hire_date
HIREDATE
FROM empleados
where salary >10000;
select salary
from empleados
where
/******************* TRANSACCIONES
*****************************************************/
pendiente