← SQL Operations Cases

Lesson 1 of 4

Count a funnel honestly

Count unique customers rather than repeated visits.

Do the work

  1. A customer may visit more than once.
  2. Count distinct customer_id for each stage.
  3. A count of events is not a count of people.

See the method

Customer 1 visited twice.

Watch the walkthrough

Read the video transcript
  1. Count a funnel honestly. Customer 1 visited twice.
  2. Count a funnel honestly. The repeated visit from customer 1 must count once.
  3. Account for partial refunds. Order 1 refunds are 20 and 10.
  4. Account for partial refunds. A direct join repeats the sale for each refund. Order 1 net is 90.
  5. Flag inventory exceptions. PEN 5 < 10 and MUG 0 < 5 are low.
  6. Flag inventory exceptions. Do not include CARD at equality or BAG with NULL.
  7. Diagnose duplicate customer keys. Avery and Morgan share team@example.test.
  8. Diagnose duplicate customer keys. The shared email has two customer IDs. Missing emails are not duplicate keys.

The video works through all four course topics; the lesson demonstrations above focus on the current step.

Practice independently

Take it further

A funnel conversion definition must use a consistent cohort; this exercise reports stage counts only.