To calculate the rolling 3-day average of the total transaction amount processed per day for January 31, we need to retrieve the transaction amounts for January 29, January 30, and January 31, and then calculate their average.
SELECT
DATE(transaction_time) AS date,
AVG(transaction_amount) AS rolling_avg
FROM transactions
WHERE DATE(transaction_time) BETWEEN '2021-01-29' AND '2021-01-31'
GROUP BY DATE(transaction_time)
HAVING COUNT(*) = 3