Skip to content
RED SAG Skills
mediumStudy question · answer published in SQL interview questions, so no pointssqlaggregation

Share of paid orders in one query

Order statuses are: paid, paid, refunded, paid, cancelled. What does this query return?

SELECT AVG(CASE WHEN status = 'paid' THEN 1.0 ELSE 0 END) AS paid_rate
FROM orders;
Choose one answer

Discussion 0

Join free to post in the discussion.

Related questions