7 de abril

2
-----------tabla temporal SQL> create table dep_emp 2 as 3 select first_name,department_name from employees a, departments b 4 where a.department_id=b.department_id; FIRST_NAME DEPARTMENT_NAME -------------------- ------------------------------ Jennifer Administration Pat Marketing Michael Marketing Sigal Purchasing Karen Purchasing Shelli Purchasing Den Purchasing Alexander Purchasing Guy Purchasing Susan Human Resources Kevin Shipping FIRST_NAME DEPARTMENT_NAME -------------------- -------------------------------------------------- ----drop table---borrar tabla ----select*from recyclebin;----papelera de reciclaje ----flashback table dep_emp to before drop;----para restaurar una tabla en este caso "dep_emp" -------------------- -------------------------------------------- first_name || last_name as nombre_completo ------------------------------------- create table general as select first_name,last_name,department_name,salary, ------------------------------------------------------ crear una tabla que incluya nombre apellidos , departamento salario pais y region -----primera create table primera as select first_name,last_name,salary,department_name,country_name,region_name from employees a,departments b, locations c, countries d, regions e where a.department_id=b.department_id and b.location_id=c.location_id and c.country_id=d.country_id and d.region_id=e.region_id; crear tabla que incluya (nombre, departamento, fecha_inicio, fecha termino) -----segunda create table segunda as select first_name,department_name,start_date,end_date from employees a, departments b, job_history c where a.department_id=b.department_id and b.department_id=c.department_id; crear una tabla que incluya (nombre_completo,pais,max_salary,minimo_salario) first_name || last_name as nombre_completo -----tercera create table tercera as

Transcript of 7 de abril

Page 1: 7 de abril

-----------tabla temporalSQL> create table dep_emp 2 as 3 select first_name,department_name from employees a, departments b 4 where a.department_id=b.department_id;

FIRST_NAME DEPARTMENT_NAME-------------------- ------------------------------Jennifer AdministrationPat MarketingMichael MarketingSigal PurchasingKaren PurchasingShelli PurchasingDen PurchasingAlexander PurchasingGuy PurchasingSusan Human ResourcesKevin Shipping

FIRST_NAME DEPARTMENT_NAME-------------------- --------------------------------------------------

----drop table---borrar tabla

----select*from recyclebin;----papelera de reciclaje

----flashback table dep_emp to before drop;----para restaurar una tabla en este caso "dep_emp"

-------------------- --------------------------------------------

first_name || last_name as nombre_completo

-------------------------------------create table generalasselect first_name,last_name,department_name,salary,------------------------------------------------------

crear una tabla que incluya nombre apellidos , departamento salario pais y region-----primeracreate table primeraasselect first_name,last_name,salary,department_name,country_name,region_name from employees a,departments b, locations c, countries d, regions e where a.department_id=b.department_id and b.location_id=c.location_id and c.country_id=d.country_id and d.region_id=e.region_id;

crear tabla que incluya (nombre, departamento, fecha_inicio, fecha termino)-----segunda

create table segundaasselect first_name,department_name,start_date,end_date from employees a, departments b, job_history cwhere a.department_id=b.department_id and b.department_id=c.department_id;

crear una tabla que incluya (nombre_completo,pais,max_salary,minimo_salario) first_name || last_name as nombre_completo-----terceracreate table terceraas

Page 2: 7 de abril

select first_name ||' '|| last_name as nombre_completo,country_name,max_salary,min_salary from employees a,departments b,jobs c,locations d,countries ewhere c.job_id=a.job_id and a.department_id=b.department_id and b.location_id=d.location_id and d.country_id=e.country_id;