\begin{frame}
\frametitle{Null Values and Aggregations}
\begin{goal}{}
Usually, \emph{null values are ignored} (filtered out) before
the aggregation operator is applied.
\smallskip
\emph{Exception:}
\begin{itemize}
\item \sql{count(*)} counts null values
\item \sql{count(*)} counts rows, not attribute values
\end{itemize}
\end{goal}
\pause\smallskip
\begin{goal}{}
If the input set is empty, aggregation functions
yield \sql{null}.
\smallskip
\emph{Exception:} \sql{count} returns \sql{0}.
\end{goal}
\smallskip
A bit counter-intuitive for \sql{sum} as one might expect \sql{0}.
\smallskip
However, allows to detect the difference between:
\begin{itemize}
\item all column values \sql{null}, or
\item values that sum up to $0$.
\end{itemize}
\end{frame}
% \overview{4}
\theme{Aggregations with Group By and Having}