Back to problems

Calculate Monthly Customer Retention

SQL · Whatnot · Medium

Write a single PostgreSQL SELECT statement or CTE that reads from the existing orders table. Do not create, drop, or modify any table. The input table has these columns: column type description order_id integer Unique order identifier customer_id integer Customer identifier order_ts timestamp Time the order was placed status text 'completed' or 'cancelled' A customer is active in a calendar month if they have at least one order in that month with status = 'completed'. For…

Checking your access…