Previous Topic: Summarizing Information From Another TableNext Topic: Joining Tables or Database Records


Testing Your Knowledge

Using the sample tables in num=A.Sample Tables and Database, code a SELECT statement for each of the queries listed below. num=B.Answers, contains one possible answer. Remember, there can be more than one way to achieve the same result when you use the SELECT statement.

  1. For each manager in table EMP, determine the number of staff reporting to the manager and the average salary of the staff members.
  2. List the number of jobs greater than 3 that are assigned to classes 10 and 50. Display the report in order by the number of jobs.
  3. For departments 6666, 4000, and 3100, list the minimum and maximum salaries within the department, provided the average departmental salary in greater than $37,800.
  4. List information about employees earning less than the average salary.