Robinhood monitors access to resources in the Robinhood app, such as account statements and tax documents. Write a PostgreSQL query that reports each user’s earliest and latest recorded access time.
Requirements
- Return every user, including users with no access-log records.
- Calculate the earliest access as
first_access_at and latest access as last_access_at using timestamp aggregation.
- Return the user ID and username, ordered by
user_id ascending.
- Preserve
NULL values for users whose access history is unavailable.