Aggregate functions aka Column functions
allow you to do jobs like calculate averages, summarize totals, or find the highest value for a given column. operates on a series of functions returning a single value
ALL
all values included in the calculation
Summary query
a SELECT statement containing one or more aggregate functions
DISTINCT
omits duplicate rows. typically used with the count function. counts rows with unique values in specified columns
COUNT (*)
counts all of the statement rows
GROUP BY
determines how the selected rows are grouped. based on one or more columns or expressions. sorts in ascending order
HAVING
determines which groups are included in the final result. specifies the condition for the group or aggregate
ORDER BY NULL
prevents MySQL from sorting rows in the GROUP BY CLAUSE
WHERE clause
can refer to any column in the base table. can't contain aggregate functions
HAVING clause
can only refer to a column included in the select clause. can contain aggregate functions
DESC
descending order
WITH ROLLUP operator
can't use order by clause. used in group by clause to add summary rows can't use DISTINCT keyword
scalar functions
operate on a single value and return a single value
ASC
ascending order
WE WILL WRITE A CUSTOM ESSAY SAMPLE ON
CH6 DATABASE HOW TO CODE SUMMARY QUERIES SPECIFICALLY FOR YOU
FOR ONLY $13.90/PAGE