MEDIUMVerified Real Interview• Data Analyst

User's Third Transaction

Uber wants to study customer habits on their platform. Specifically, they want to examine the third transaction of every user who has made at least 3 transactions.

Write a query to obtain the:

  • user_id
  • spend
  • transaction_date

for each user's third transaction. Sort the output by user_id ascending.

Table:

  • transactions (user_id INT, spend DECIMAL, transaction_date TIMESTAMP)

Execution Sandbox:

Your query executes inside an isolated in-memory PostgreSQL engine (PGlite WebAssembly). You have full access to standard PostgreSQL aggregations, window functions, and CTEs.

Standard SQL (ANSI)|Ln 1, Col 1
⌘↵ Run Query
Ready to execute. Press Run (⌘+Enter)
Write your query and click “Run” or press ⌘+Enter to inspect output.