La desgracia de un sueño inesplicable

Solo disponible en BuenasTareas
  • Páginas : 3 (623 palabras )
  • Descarga(s) : 0
  • Publicado : 9 de septiembre de 2010
Leer documento completo
Vista previa del texto
Practice 2: Overview
In this practice, you build more reports, including statements that use the WHERE clause and the ORDER BY clause. You make the SQL statements more reusable and generic byincluding ampersand substitution.
Practice 2
The HR department needs your assistance with creating some queries.
1. Because of budget issues, the HR department needs a report that displays the last nameand salary of employees who earn more than $12,000. Place your SQL statement in a text file named lab_02_01.sql. Run your query.

2. Create a report that displays the last name and departmentnumber for employee number 176.

3. The HR department needs to find high-salary and low-salary employees. Modify lab_02_01.sql to display the last name and salary for any employee whose salary is notin the range of $5,000 to $12,000. Place your SQL statement in a text file named lab_02_03.sq



Practice 2 (continued)
4. Create a report to display the last name, job ID, and start datefor the employees with the last names of Matos and Taylor. Order the query in ascending order by start date.

5. Display the last name and department number of all employees in departments 20or 50 in ascending alphabetical order by name.


6. Modify lab_02_03.sql to display the last name and salary of employees who earn between $5,000 and $12,000 and are in department 20 or 50.Label the columns Employee and Monthly Salary, respectively. Resave lab_02_03.sql as lab_02_06.sql. Run the statement in lab_02_06.sql.

Practice 2 (continued)
7. The HR department needs a reportthat displays the last name and hire date for all employees who were hired in 1994.



8. Create a report to display the last name and job title of all employees who do not have amanager.

9. Create a report to display the last name, salary, and commission of all employees who earn commissions. Sort data in descending order of salary and commissions.

10. Members of the...
tracking img