IFS180 Intro. to Data Management Chapter 13 – Grouping Data
Why group data? How do aggregate functions (MIN / MAX / SUM) compare? Grouping data is performed on given column name(s)
Chapter 13 – Grouping Data GROUP BY Clause: Functions with the logical table (i.e. the result set) created by the From and the Where clause Specify the column name(s) from the result set to group by Clause: GROUP BY column reference,….. Limitations. When mixing aggregate functions and column references, must list all column names in the group by clause. Table order is also important.
Chapter 13 – Grouping Data Example. What is the team average in the bowling league? Example. What is the accuracy of the bowlers average in the bowlers table?
Chapter 14 – Filter Grouped Data Accomplished by Having clause Punctuation Having search condition Restrictions Columns must be named in the Group By clause or be an aggregate function column in the select statement
Chapter 14 – Filtering Group Data Example. What is the accuracy of the bowlers average in the bowlers table and only include those bowlers with over 7000 pins? Example. What is the average of the bowlers that live in Duvall with a total score greater than or equal to 7000?