\begin{frame}
\frametitle{Natural Joins}
\begin{code}{\textwidth}{``Natural join'' in SQL-92}
\small
\BUseVerbatim{query2}
\end{code}
Note the use of \emph{natural join}!
\pause\bigskip
DBMS to automatically add the join predicate to the query:
\begin{tcenter}
\begin{code}{.7\textwidth}{}
\small\centering
\sql{Results.category = Exercises.category \\and Results.number = Exercises.number}
\end{code}
\end{tcenter}
% SQL-92 permits joins in the \sql{from} clause as well as at the
% outermost query level (like \sql{union}). This comes close to RA.
\pause\bigskip
\begin{goal}{}
In a \emph{natural join}, the join predicate arises implicitly
by \emph{comparing all columns with the \alert{same name}} in both tables.
\end{goal}
\end{frame}