\begin{frame}
\frametitle{Nested Subqueries}
\begin{goal}{}
\emph{Subqueries may be nested!}
\end{goal}
\pause\smallskip
\begin{code}{\textwidth}{List the students who solved all homework assignments}
\small
\mpause[2]{\BUseVerbatim{query}}
\end{code}
\pause
\emph{Inner} query: all results for student \sql{S} and homework \sql{E}.\\
\emph{Middle} query: homework of student \sql{S} for which no result exists.\\
\emph{Outer} query: students that have no homework without results.\hspace*{-2cm}\ \\
\bigskip
%% ``List those Students S, where there is no homework E for which there
%% exists no entry for (S,E) in the Results.''
%%
%% { (S.first, S.last) | S:Students /\
%% not (exists E (E:Exercises /\ E.cat = 'H' /\
%% not (exists R (R:Results /\
%% R.sid = S.sid /\
%% R.eno = E.eno /\
%% R.cat = 'H')))) }
\end{frame}