User Directory
Return all users showing user_id, country, and signup_date, ordered by user_id.
- Date analysis
- Sorting
Challenge brief
Understand the request
Growth Analytics The growth team needs a baseline roster of all registered users for an upcoming geo-targeting campaign.
List every user with their country and signup date.
Return
- user_id
- country
- signup_date
Constraints
- Return 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 user directory contains every requested attribute.
Hint 2
Project the three fields without filtering rows.
Hint 3
Apply the user identifier as the final ordering 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 with ORDER BY user_id. No JOIN or filter needed — all columns come from the users table.
Success check
Returns the complete deterministic result for user directory
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 | IN | 2023-06-01 |
| 7 | US | 2023-06-10 |
| 8 | DE | 2023-07-01 |
| 9 | BR | 2023-07-15 |
| 10 | FR | 2023-08-01 |
Previewing 10 of 11 expected rows. Review the published expected result before browsing the runnable collection.
Learn the concepts behind this answer
Strengthen your understanding with these targeted learning topics:
Continue practicing
Explore related company challenges
Google
Independent Google-style search, advertising, user-engagement, and video-product SQL practice.
Meta
Independent Meta-style social-product, engagement, content, community, messaging, and advertising SQL practice.
Airbnb
Independent Airbnb-style marketplace, booking, listing, payment, review, and guest analytics SQL practice.
Return to the complete interview preparation experience.