This query is used to display the top 40 delivery agents with the highest average rating.

\begin{lstlisting}
SELECT
    da.daID,
    CONCAT(da.first_name, ' ', da.middle_initial, ' ', da.last_name) AS name,
    da.email,
    AVG(dr.rating) AS avg_rating
FROM
    da_review dr,
    delivery_agent da
WHERE da.daID = dr.daID
GROUP BY da.daID
ORDER BY avg_rating DESC
LIMIT 40;
\end{lstlisting}