-\subsection{SQL Working}
-\begin{frame}[fragile]{SQL Working}
- % example SQL query
-\begin{lstlisting}[language=SQL]
-SELECT count(*) FROM bug
-WHERE last_modified > '2014-07-01'
-AND done IS NOT NULL
-AND owner IS NOT NULL;
-\end{lstlisting}
-\begin{visibleenv}<2>
-\begin{lstlisting}
- count
+\subsubsection{Fun Queries}
+
+\begin{frame}[fragile]{Messages to bugs}
+\small
+\begin{minted}{sql}
+SELECT count(*),c.addr FROM
+message_correspondent mc
+JOIN correspondent c ON mc.correspondent=c.id
+WHERE correspondent_type='from'
+GROUP BY mc.correspondent,c.addr
+ORDER BY count DESC LIMIT 5;
+\end{minted}
+\begin{verbatim}
+ count | addr
+-------+---------------------------------
+ 5123 | bubulle@debian.org
+ 4346 | joeyh@debian.org
+ 4214 | biebl@debian.org
+ 3875 | tbm@cyrius.com
+ 3632 | ftpmaster@ftp-master.debian.org
+\end{verbatim}
+\end{frame}
+
+\begin{frame}[fragile]{Single-message correspondents}
+\small
+\begin{minted}{sql}
+SELECT count (*) FROM
+(SELECT count(*),c.addr
+ FROM message_correspondent mc
+ JOIN correspondent c ON
+ mc.correspondent=c.id
+ WHERE correspondent_type='from'
+ GROUP BY mc.correspondent,
+ c.addr
+ HAVING count(*) = 1) AS foo;
+\end{minted}
+\begin{verbatim}
+ count