Practica de base de datos sql

965 views

Published on

0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
965
On SlideShare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
32
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Practica de base de datos sql

  1. 1. Universidad Autónoma de Santo Domingo (UASD)Centro Universitario Regional de La Vega (CURVE) Asignatura Base de Datos Practica de: Consultas de SQL Profesor José Manuel Amado Preparado por: Víctor M. Méndez DF7979
  2. 2. Consulta # 1 select * fromemployee wheredept_id=200;Consulta # 2selectemp_lname,emp_fname, salaryfromemployeewheresalary>50000 and salary<80000;
  3. 3. Consulta # 3selectemp_lname,emp_fname, salaryfromemployeewhere sex=women orsalary<80000;Consulta # 4selectemp_lname,emp_fname,dept_id,salaryfromemployeewheresalary>50000 and dept_id!=200;
  4. 4. Consulta # 5selectemp_lname,emp_fname,salaryfromemployeewheresalarybetween 40000 and 55000;
  5. 5. Consulta # 6select *fromemployeewheredept_id in (100,300);Consulta # 7selectemp_fname,emp_lname,dept_idfromemployeewhereemp_fname=fran;
  6. 6. Consulta # 8selectemp_fname,emp_lname,cityfromemployee, departmentwhereemp_fname=fran and employee.dept_id=department.dept_id;Consulta # 9selectdept_id,MAX(salary)fromemployeegroupbydept_id;
  7. 7. Consulta # 10selectdept_name,SUM(salary),COUNT(*),AVG(salary)fromdepartment,employeewhereemployee.dept_id=department.dept_idGROUP BY dept_name;Consulta # 11selectemp_fname,emp_lname,cityfromemployeewherecity= (selectcityfromemployeewhereemp_fname=fran);
  8. 8. Consulta # 12selectemp_fname,emp_lname,salaryfromemployeewheresalary> (select AVG(salary)fromemployee);

×