Previous Topic: Exercise 5-5Next Topic: Exercise 5-7


Exercise 5-6

Now You Try It

The Human Resources department is concerned that the company have a healthy group of employees. They need to see the smallest amount of sick time taken. The BENEFITS table contains this information.

The result looks like this:

   (EXPR)    ------      0.00 1 row processed

If your results do not match what you see above, check Review Answers for Chapter 5 for the correct SQL syntax.

SUM

Use the aggregate function SUM to total numeric columns.

How It's Done

The budget group in the Accounting department needs to allocate funds for next year's budget based on this year's salaries.

To obtain a sum of all salaries, enter:

select sum(salary_amount)
       from position;

The result looks like this:

                          (EXPR)                           ------                       2555058.42 1 row processed