\textbf{Feature:} This query is used to display the entire product catalogue. \\
\textbf{Location:} In function \texttt{search()} in \texttt{front-end/\_\_init\_\_.py}

\begin{lstlisting}
SELECT p.productID, p.name, p.price, AVG(pr.rating) AS avg_rating, p.quantity
FROM product p
LEFT JOIN product_review pr ON p.productID = pr.productID
GROUP BY p.productID
ORDER BY p.name ASC;
\end{lstlisting}

A variation\footnote{
    In this variant, \texttt{search} is the key entered by the user for searching.
    It is substituted into the query using Python f-strings.
}  of the same query (which uses pattern matching in SQL) is also used to search through the product catalogue.

\begin{lstlisting}
SELECT p.productID, p.name, p.price, AVG(pr.rating) AS avg_rating, p.quantity
FROM product p
LEFT JOIN product_review pr ON p.productID = pr.productID
WHERE p.name LIKE '%{search}%'
GROUP BY p.productID
ORDER BY p.name ASC;
\end{lstlisting}