CIT 111 Wk 10
SELECT order of execution
FROM, WHERE, GROUP BY, HAVING, SELECT, ORDER BY, LIMIT
SELECT clause syntax order
SELECT, FROM, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT
one single, one single
Scalar functions take ______ value in for each row and return _______ value for each row
before, after
The WHERE clause filters _______ the data is grouped with GROUP BY and the HAVING clause filters _____ the data is grouped with GROUP BY
GROUP BY
You can use non-aggregate column names in the SELECT if you have already listed them in the _______ clause first
HAVING
a clause that works with aggregate functions and allows you to filter the groups
GROUP BY
a clause used when you have an aggregate function that you want to use on a group of data
aggregate function
a function that operates on a set of rows to calculate and return a single value. AVG, SUM, and COUNT are examples
a group of, one single
aggregate functions take _______ of value in and return ______ value
ROLLUP
an operator that can be used with grouping and aggregates, allowing you to add one or more summary rows to your results
summary query
used to summarize the contents of a table. these queries contain one or more aggregate functions
aggregate
the GROUP BY clause is used when you have an _____ function that you want to use on the grouped data
MAX
the ____ aggregate function returns the highest value of a set of rows
WHERE, HAVING
the ____ clause filters rows and the _____ clause filters groups
AVG
the _____ aggregate function returns an average value of a set of rows
GROUP BY
the _____ clause allows you to separate the data out into groups, then the aggregate function uses the data within the groups to calculate the results, each group getting their own row
HAVING
the ______ clause works with the GROUP BY clause to filter the results if certain conditions are true. It limits the groups included in the result set