Itec350Group_Chapter6_PowerpointPresentation2

Itec350Group_Chapter6_PowerpointPresentation2 - Chapter 6...

This preview shows pages 1–9. Sign up to view the full content.

Click to edit Master subtitle style 10/19/10 Chapter 6 Summarizing & Grouping Data Gustavo Tovar-Banda, Gabriel Wright, Elisa Gutierrez,   Holly Jordan, Katie Hamilton, Fernando Chiossoni

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10/19/10 Introduction of Chapter 6 § SQL aggregate functions, or set functions, which  operate on a group of values to produce a single,  summarizing value. § Aggregate applied to a set of rows:       - all the rows in a table       -only those rows specified by a WHERE               clause       - the rows created by a GROUP BY clause
10/19/10 GROUP BY clause § Groups rows  § Often used with a HAVING clause, which filters  groups § Returns a single statistic: §     -a sum, minimum, or average

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10/19/10 Using Aggregate Functions § Aggregate Functions
10/19/10 Creating Aggregate Expressions § An aggregate expression can’t appear in a WHERE  clause § You can use more than one aggregate expression in a  SELECT clause § You can’t mix nonaggregate (row-by-row) and  aggregate expressions in a SELECT clause § SELECT-all nonaggregate expressions or all aggregate  expressions § Exception – you  can  mix nonaggregate and aggregate

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10/19/10 Creating Aggregate Expressions Continued § Can’t nest aggregate functions § You can use aggregate expressions in subqueries. § You can’t use subqueries in aggregate expressions.
10/19/10 Finding a Minimum with MIN() § Use the aggregate function MIN () to find the  minimum of a set values.  § Type: MIN (expr) § Expr is a column name, literal, or numeric expression.  The result’s data type is at least as precise as the most  precise data type used in expr. § MIN() works with character, numeric, and datetime  data types.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
10/19/10 Finding a Maximum with MAX() § Use the aggregate function MAX() to find the  maximum set of values.  § Type: MAX(expr) § MAX() works with character, numeric, and datetime  data types.  § With character data columns, MAX() finds the value  that is highest in the sort sequence.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 29

Itec350Group_Chapter6_PowerpointPresentation2 - Chapter 6...

This preview shows document pages 1 - 9. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online