3. Daily Revenue


"Fields like refunded_at will only have data if the transaction was refunded, and otherwise left null."


"Complete the query by filtering for refunded_at is not null."

We should filter using IS NULL. It means that there wasn't any refund. If "refunded_at" field contains a date there was a refund.


I have the same question!


exactly, it must be "IS NULL". I reported it too.


Just here to also leave the same comment, the instructions are giving us the refunded amounts, not the revenue with refunds excluded. Thought I was going crazy for a second there!


use this

round(sum(price), 2) as daily_rev
from purchases
where refunded_at is not null
group by 1
order by 1;

in which the where statement says " where is not null "


So happy you wrote here, I was starting to question my basic logic!


IT must be IS NULL. If it IS NULL then there was no refund therefore that field should be included in overall profit.


I had the same thought myself. Glad to see I'm not alone. Part of coding is understanding the logic of how to word something, and it doesn't help when the example is wrong!