\begin{frame}
\frametitle{How to Determine Keys: Examples}
\begin{exampleblock}{}
Find \emph{all} minimal keys the relation $\sql{R}$
\begin{tcenter}
{\ttfamily\centering
\colorbox{rellight}{%
\begin{tabular}[t]{|r|r|r|r|r|}
\multicolumn{5}{c}{R} \\ \hline
\hd{A} & \hd{B} & \hd{C} & \hd{D} & \hd{E} \\
\hline
\end{tabular}%
}}
\end{tcenter}
with the functional dependencies
\begin{talign}
A &\to D &
B &\to C &
B &\to D &
D &\to E
\end{talign}
We get
\begin{enumerate}
\pause
\item $\textit{Candidates} = \{\; \{\, A,B \,\} \;\}$\\
since $A,B$ do not occur in any right-hand side
\pause
\item $\{\, A,B \,\}^+ = \pause \{\, A,B,C,D,E \,\}$\\
So $\{\, A,B \,\}$ is a key.
\pause
\item $\textit{Candidates} = \{\; \;\}$ \\
No more candidate keys to check, we terminate.
\end{enumerate}
\end{exampleblock}
\end{frame}