AnalystPath

Last-Touch Attribution Revenue

SQLMediumMid levelGoogle~15 min

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_iduser_idchanneltouch_date
conversions
conversion_iduser_idrevenue

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

Related SQL questions