1. The document discusses database structures including tables for departments and employees with corresponding columns and data types.
2. Examples of SQL queries are provided to select data from the employees table including employee details and concatenating columns, and using functions like DISTINCT, WHERE, and ORDER BY.
3. More complex queries with WHERE clauses are shown using operators like >, BETWEEN, IN, LIKE and conditions on columns such as salary, employee ID, last name, and department ID.
1. The document discusses database structures including tables for departments and employees with corresponding columns and data types.
2. Examples of SQL queries are provided to select data from the employees table including employee details and concatenating columns, and using functions like DISTINCT, WHERE, and ORDER BY.
3. More complex queries with WHERE clauses are shown using operators like >, BETWEEN, IN, LIKE and conditions on columns such as salary, employee ID, last name, and department ID.
1. The document discusses database structures including tables for departments and employees with corresponding columns and data types.
2. Examples of SQL queries are provided to select data from the employees table including employee details and concatenating columns, and using functions like DISTINCT, WHERE, and ORDER BY.
3. More complex queries with WHERE clauses are shown using operators like >, BETWEEN, IN, LIKE and conditions on columns such as salary, employee ID, last name, and department ID.
1.2 error at line: 1 Colum:10 1.3 error at line: 1 Colum:38 2) a)Estructura departments: Es una tabla con cuatro columnas con sus tipos de datos establecidos. Tiene como contenido department_id : llave primaria, department_name: siendo este el atributo de la tablas, manager_id: es la llave fornea con la tabla Manager_id, location:id: es la llave fornea con la tabla Location_id b)Estructura Employees: Es un tabla con once columnas las cuales cada una tiene sus datos correspondientes contenido: Employeed_id: llave primaria, First_name:nombre del empleado, entre otras, y teniendo como llaves forneas manager_id: comunica con el id de manager ,department_id:comunica con el id de la tabla departamentos 1 King
AD_PRES
24000 2 Kochhar
AD_VP
17000 3 De Haan
AD_VP
17000 4 Hunold
IT_PROG
9000 5 Ernst
IT_PROG
6000 6 Austin
IT_PROG
4800 7 Pataballa
IT_PROG
4800 8 Lorentz
IT_PROG
4200
9 Greenberg
FI_MGR
12000
10 Faviet FI_ACCOUNT 9000 Taller 1: Bases de Datos avanzada
Hoollman Lopez c) Select employee_id,last_name,job_id, hire_date AS Startdate FROM employees; d) Select distinct job_id FROM employees; e) Select last_name ||', '|| job_id as concatenado FROM employees ; f) Select employee_id || first_name || last_name || email|| phone_number||hire_date||job_id||salary||commission_pct||manager_id||department_id as THEoutput FROM employees ; 3) 3.1) select last_name, salary from employees where salary>12000; 3.2) select * from employees where employee_id=176; 3.3) select last_name, salary from employees where salary not between 5000 and 12000; 3.4 )select last_name, job_id,hire_date from employees where last_name like '%Matos' or last_name like 'Taylor' order by job_id DESC ; 3.5) select last_name, department_id from employees where department_id between 20 and 50 order by first_name asc; 3.6) select last_name, salary, commission_pct from employees where commission_pct=0.2;
4) 4.1) select current_date as fecha from dual; 4.2) select job_id,last_name,salary, salary+(salary*0.15) as new_salary from employees ; 4.3) select job_id,last_name,salary, salary+(salary*0.15) as new_salary, (salary+(salary*0.15))- salary from employees; 4.4) SELECT UPPER(SUBSTR(last_name,1,1)) || SUBSTR(last_name,2)as apellido, LENGTH(last_name)as longitud from employees where first_name like 'J%' or first_name like 'A%' or first_name like 'M%' order by last_name;
4.5) SELECT last_name, trunc(MONTHS_BETWEEN (sysdate,hire_date)) AS months_worked FROM employees order by months_worked; 4.6)