\begin{frame} \frametitle{Not Exists} \query \begin{goal}{} First, \sql{S} is the \sql{Students} tuple \begin{tcenter} \raisebox{-1ex}{\colorbox{rellight}{% \footnotesize\ttfamily \begin{tabular}{|r|r|r|r|} \hline \hd{sid} & \hd{first} & \hd{last} & \hd{address} \\ \hline 101 & George & Orwell & London \\ \hline \end{tabular}% }}\pause\vspace{1ex} \end{tcenter} In the subquery, \sql{S.sid} is instantiated by \sql{101}:\\[1ex] ~~\begin{minipage}{.5\textwidth}% \footnotesize\ttfamily% $ \begin{array}{ll} \sql{select} & \sql{*} \\ \sql{from} & \sql{Results R} \\ \sql{where} & \sql{R.category = \textquotesingle{}homework\textquotesingle{}} \\ \sql{and} & \sql{R.sid = {\setlength{\fboxsep}{2pt}\fbox{101}}} \end{array} $ \end{minipage} \begin{minipage}{.4\textwidth} \tableTiny \colorbox{rellight}{% \begin{tabular}[t]{|r|r|r|r|} \multicolumn{4}{c}{Query Result} \\ \hline \hd{sid} & \hd{category} & \hd{number} & \hd{points} \\ \hline 101 & homework & 1 & 10 \\ 101 & homework & 2 & 8 \\ \hline \end{tabular}% } \end{minipage}\\[1ex]\pause The result is non-empty. Thus the \sql{not exists} is false for \emph{this} \sql{S}. \end{goal} \vspace{10cm} \end{frame}