29/73
\begin{frame}
  \frametitle{Null Values: Problems}

  \begin{alertblock}{}
    Since the same null value is used for quite different purposes,
    there can be \textbf{no clear semantics.}
  \end{alertblock}
  \pause

  \begin{alertblock}{}
    SQL uses a \textbf{three-valued logic} (true, false, unknown)
    for the evaluation of comparisons that involve null values.\\    
    \remark{%
      For users accustomed to two-valued logic, the outcome is often surprising.
    }
  \end{alertblock}

  \begin{quiz}{\textwidth}{Which of these queries return rows with \sql{NULL} in column A?}
    \begin{enumerate}
      \item \sql{SELECT * FROM R WHERE A = 42}
      \item \sql{SELECT * FROM R WHERE NOT (A = 42)}
      \item \sql{SELECT * FROM R WHERE A = NULL}
    \end{enumerate}
  \end{quiz}
  \pause
  None of these queries does!
  Use \sql{... WHERE A IS NULL}.
  \pause
  
  \begin{alertblock}{}
  Some programming languages do not know about null values. \\
  \remark{%
    Explicit null value check and treatment required when reading attribute values into program variables.
    This complicates application programs.
  }
  \end{alertblock}
\end{frame}