SQL SELECT


Database schema before class: restaurant_inpsections.sql
Slides from class
SQL script from class

Database notes

aggregate functions
SQL functions that return a summary of data. These include: average (AVG), min, max, sum, and count.
NULL
The absence of a value/value is unknown. Not a blank! Can cause issues if used in conditional evaluation (e.g., false and null is null, not false).
GROUP BY
A SQL clause used to create frequency distributions when combined with any of the aggregate functions in a SELECT command.
HAVING
A clause applied to the output of a GROUP BY operation to restrict the selected rows.
nested query (subquery or inner query)
A query within another query. In a SELECT command, a nested query can be used in the SELECT, FROM, or WHERE clauses.
WITH
A SQL clause that provides a way of defining a temporary relation whose definition is available only to the query in which the WITH clause occurs.
Note: many definitions from Coronel and Morris.