56/232
\begin{frame}
  \frametitle{Duplicate Elimination}
  
  \begin{code}{\textwidth}{}
    \small\centering
    \BUseVerbatim{query}
  \end{code}
  \ \\[.5ex]
  
  Let us assume that $(\sql{FIRST}, \sql{LAST})$ is a key for \sql{STUDENTS}.
  
  \begin{enumerate}
  \pause
  \item Initialize $\mathcal{K} = \pause \{ \sql{S.FIRST}, \sql{S.LAST}, \sql{R.ENO}, \sql{R.POINTS} \}$.
  \pause
  \item [2.] $\mathcal{K} + \{ \sql{R.CAT} \}$ because of $\sql{R.CAT = \textquotesingle{}H\textquotesingle{}}$
  \pause 
  \item [2.] $\mathcal{K} + \{ \sql{S.SID}, \sql{S.EMAIL} \}$ as $\mathcal{K}$ contains a key of \sql{STUDENTS}
  \pause 
  \item [2.] $\mathcal{K} + \{ \sql{R.SID} \}$ because of the conjunct \sql{S.SID = R.SID}
  \end{enumerate}
  \pause
  $\mathcal{K}$ contains a key of 
  \begin{itemize}
    \item \sql{STUDENTS S} (\sql{S.FIRST}, \sql{S.LAST}) and
    \item \sql{RESULTS R} (\sql{R.SID}, \sql{R.CAT}, \sql{R.ENO})
  \end{itemize}
  \pause
  Thus \sql{DISTINCT} is superfluous.
  
  \pause
  \begin{alertblock}{}
    If \sql{FIRST}, \sql{LAST} were no key of \sql{STUDENTS}, this
    test would not succeed (and rightly so).
  \end{alertblock}
\end{frame}