Customer Cohort Retention
Calculate how many customers from each acquisition month (cohort) placed orders in their first month. Return columns: cohort_size, cohort_month, retention_rate, first_month_orders. Order results by: c.cohort_month.
Work through 12 expert SQL exercises in a structured sequence. Each challenge includes a clear problem, schema context and an interactive query editor.
Calculate how many customers from each acquisition month (cohort) placed orders in their first month. Return columns: cohort_size, cohort_month, retention_rate, first_month_orders. Order results by: c.cohort_month.
Find customers who purchased products from both Software and Infrastructure. Return columns: customer_name, category_count. Order results by: c.name.
Calculate the number of days between each customer's consecutive orders while retaining the current and previous order dates.
Use a self LEFT JOIN to list every employee with their direct manager's first name. Return columns: id, first_name, manager_name. Order results by: e.id.
Find products whose order-item revenue exceeds 250. Return columns: revenue, units_sold, product_name. Order results by: revenue DESC, product_name.
Find products whose order-item revenue exceeds 500. Return columns: revenue, units_sold, product_name. Order results by: revenue DESC, product_name.
Find products whose order-item revenue exceeds 750. Return columns: revenue, units_sold, product_name. Order results by: revenue DESC, product_name.
Find products whose order-item revenue exceeds 900. Return columns: revenue, units_sold, product_name. Order results by: revenue DESC, product_name.
Find products whose order-item revenue exceeds 1200. Return columns: revenue, units_sold, product_name. Order results by: revenue DESC, product_name.
Find products whose order-item revenue exceeds 1500. Return columns: revenue, units_sold, product_name. Order results by: revenue DESC, product_name.
Find products whose order-item revenue exceeds 1800. Return columns: revenue, units_sold, product_name. Order results by: revenue DESC, product_name.
Find products whose order-item revenue exceeds 2500. Return columns: revenue, units_sold, product_name. Order results by: revenue DESC, product_name.