Last 5 events of user 970
Level: JuniorTopic: Sorting and LIMIT50 XP
Instructions
Select id, event_time and event_type of the 5 most recent events of the user with user_id = 970. Sort by event_time from newest to oldest, for equal values by id descending.
Hints
Each next one is more detailed and costs more
Query
Result
Click Run to see the query result, or Check to submit your solution.
Dataset schema
Exactly oneZero or oneZero or more
Table relationships
- N:1Many-to-one
events.→user_id users.id - N:1Many-to-one
purchases.→user_id users.id
Table data
PostgreSQL
Select a table in the diagram or list to view its rows.