SELECT 
    DAYNAME(t.transaction_date) as day_of_week,
    COUNT(DISTINCT t.id) as number_of_orders,
    AVG(t.final_total) as average_order_value,
    SUM(t.final_total) as total_revenue
FROM transactions t
WHERE t.type = "sell" 
AND t.status = "final"
AND t.transaction_date >= DATE_SUB(CURRENT_DATE, INTERVAL 30 DAY)
GROUP BY DAYNAME(t.transaction_date)
ORDER BY FIELD(DAYNAME(t.transaction_date), 
    "Monday", "Tuesday", "Wednesday", "Thursday", 
    "Friday", "Saturday", "Sunday");