Guest Directory
Return user_id, country, and signup_date for all users, ordered by user_id.
- Date analysis
- Sorting
Challenge brief
Understand the request
Trust & Safety Trust & Safety needs a complete user roster for a compliance audit on account origins.
List every registered user with their country and signup date.
Return
- user_id
- country
- signup_date
Constraints
- Include every registered user
- Order by user ID
Data you will use
Review the relevant tables before deciding how to join, filter, or aggregate them.
users
user_idINTEGERcountryVARCHAR(50)signup_dateDATE
Hints, when you need them
Open one clue at a time so you still do the reasoning.
Hint 1
The requested attributes share one account table.
Hint 2
Project only the requested user fields.
Hint 3
Stabilize the roster with the user key.
Verified SQL answer
Attempt the problem first, then compare structure and reasoning—not just syntax.
Reveal solution and explanation
SELECT user_id, country, signup_date FROM users ORDER BY user_idWhy this works
A plain SELECT from users with ORDER BY user_id. All three columns come from the same table — no JOIN or filter needed.
Success check
Returns one row per user in stable user order
Expected result
Use this output to verify values, aliases, ordering, and row count.
| user_id | country | signup_date |
|---|---|---|
| 1 | US | 2023-01-10 |
| 2 | IN | 2023-02-15 |
| 3 | UK | 2023-03-20 |
| 4 | CA | 2023-04-12 |
| 5 | US | 2023-05-05 |
| 6 | FR | 2023-06-01 |
| 7 | US | 2023-06-10 |
| 8 | DE | 2023-07-01 |
| 9 | BR | 2023-09-15 |
Learn the concepts behind this answer
Strengthen your understanding with these targeted learning topics:
Continue practicing
Explore related company challenges
Uber
Independent Uber-style mobility marketplace SQL practice covering trips, drivers, riders, pricing, payments, and promotions.
Amazon
Independent Amazon-style e-commerce, warehouse, inventory, and customer analytics SQL practice.
Meta
Independent Meta-style social-product, engagement, content, community, messaging, and advertising SQL practice.
Return to the complete interview preparation experience.