Exercise · SQL & Querying
Predict, then run it
Predict the output
fees(d, amount) has enrolment on just Feb-02 (80). Produce the complete Feb 1–4 week, quiet days zero-filled:
SELECT strftime(t.g, '%m-%d') AS day, COALESCE(SUM(f.amount), 0) AS total FROM generate_series(DATE '2024-02-01', DATE '2024-02-04', INTERVAL 1 DAY) AS t(g) LEFT JOIN fees f ON f.d = t.g GROUP BY t.g ORDER BY t.g;
Predict the exact output.