TikTok
Foundations Track · Easy · 15 min
First Customer Transaction
TikTok is reviewing first customer transaction through a scorecard. Return each user_id and transaction_date for the first transaction made by that user. Sor...
Company labels are directional practice context, not official interview guidance.
Objective
Practice query basics through a TikTok-tagged business scenario.
Approach
Use this track to lock in clean query structure, basic filtering logic, and confidence with grouped output.
Company context
Company labels are directional practice context, not official interview guidance.
TikTok is reviewing first customer transaction through a scorecard. Return each user_id and transaction_date for the first transaction made by that user. Sort by user_id.
user_transactions
| transaction_id | user_id | transaction_date | spend | 2 |
|---|---|---|---|---|
| 1 | 101 | 2024-01-03 | 19.00 | |
| 2 | 101 | 2024-01-08 | 25.00 | |
| 3 | 101 | 2024-01-12 | 18.50 | |
| 4 | 102 | 2024-01-02 | 14.00 | |
| 5 | 102 | 2024-01-09 | 22.00 | |
| 6 | 103 | 2024-01-01 | 30.00 | |
| 7 | 103 | 2024-01-05 | 26.00 | |
| 8 | 103 | 2024-01-07 | 24.00 |
SQL workspace
Run queries against the protected question data, then submit once the result shape looks right.
Sign in to run SQL
Create a free account or sign in before running queries against protected question data.