\textbf{Feature:} This query is used to find out the trends in the number of orders on a monthly, quarterly, and yearly basis. \\
\textbf{Location:} In function \texttt{admin\_stats(page)} in \texttt{front-end/\_\_init\_\_.py}

\textbf{Usage:}
Non-empty month, quarter, and year values indicate monthly, querterly, and yearly trends in order.
An overall total is also provided by the roll-up query.

\begin{lstlisting}
SELECT
    YEAR(order_date) AS date_year,
    QUARTER(order_date) AS date_quarter,
    MONTH(order_date) AS date_month,
    COUNT(orders.orderID) AS order_count,
    SUM(price * order_product.quantity) AS revenue
FROM orders
JOIN order_product ON orders.orderID = order_product.orderID
JOIN product ON order_product.productID = product.productID
GROUP BY date_year, date_quarter, date_month WITH ROLLUP
ORDER BY date_year DESC, date_month DESC;
\end{lstlisting}