{

  \begin{tabular}{c|c|c}
    $T_R$ & $T_1$ & $T_1$ \\
    (\sql{report}) & (\sql{new-receipt}) & (\sql{close-batch}) \\
    \hline
\hspace{-0.5cm}
\begin{minipage}{0.4cm}
\centering
\vspace{0.25cm}~\\
\begin{tikzpicture}[>=latex,line join=bevel,]
\pgfsetcolor{black}
\draw [->,line width=0.5pt] (0,14) -- (0,0);
\end{tikzpicture}
\small \it time
\vspace{-4em}
\\\-\\
\end{minipage}
\begin{lstlisting}[language={[example]sql}]
                   
                   
                   
                   
                   
                   
                   
                   
                   
$x \gets$	SELECT
	 current_batch
                   
SELECT SUM(amount)
FROM receipts
WHERE batch = $x-1$
                   
COMMIT               
                   
                   
                   
                   
                   
.                   
\end{lstlisting}
&
\scriptsize
\begin{lstlisting}[language={[example]sql}]

$x \gets$	SELECT
	 current_batch

                  
                  

                  

                  
                  

                  
                  
                  

                     

INSERT INTO
receipts
VALUES
(x, somedata)
                  
COMMIT            
\end{lstlisting}
&
\scriptsize
\begin{lstlisting}[language={[example]sql}]




INCREMENT
current_batch

COMMIT

                
                

                
                
                

                   





.                 
\end{lstlisting}
  \end{tabular}
\vspace{2em}
}
