Last-Touch Attribution Revenue
Problem
**[Asked at Google]**
Last-touch attribution credits the **most recent channel** that touched a
user with the full conversion revenue.
For each channel, return `attributed_revenue` ordered descending.
Tables
Example rows — the live problem includes the full dataset.
touches
| touch_id | user_id | channel | touch_date |
|---|
conversions
| conversion_id | user_id | revenue |
|---|
Expected output
Your answer should return 3 rows with the columns channel, attributed_revenue.
Starter code (SQL)
SELECT *
FROM touches;Solve this SQL question free
Write SQL and run it instantly in your browser — even on your phone. No signup needed to try.
Solution & explanation
Create a free account to unlock the optimal solution, a step-by-step explanation, and the hidden test cases that grade your answer.
Sign up free to unlock