Inactive Accounts
Which user accounts are currently inactive?
- Filtering
- Sorting
Challenge brief
Understand the request
Trust & Safety is preparing a re-engagement outreach list and needs all accounts currently marked inactive.
List all inactive user accounts with basic profile information.
Return
- user_id
- username
- country
- status
Constraints
- Return accounts whose status is 'inactive'
- Order by user ID
Data you will use
Review the relevant tables before deciding how to join, filter, or aggregate them.
users
user_idINTEGERusernameVARCHAR(50)emailVARCHAR(100)countryVARCHAR(50)statusVARCHAR(20)
Hints, when you need them
Open one clue at a time so you still do the reasoning.
Hint 1
All data lives in the users table. The status column holds 'active' or 'inactive' — filter to the inactive rows.
Hint 2
Single-table query: WHERE status = 'inactive'. No JOIN required.
Hint 3
Start with the tables that establish the result grain for question 16, select the required output aliases, and add the remaining joins, filters, aggregation, and ordering one clause at a time.
Verified SQL answer
Attempt the problem first, then compare structure and reasoning—not just syntax.
Reveal solution and explanation
SELECT user_id, username, email, country, status FROM users WHERE status = 'inactive' ORDER BY user_idWhy this works
Filter the user population to the inactive account state and return the requested profile fields in stable user-ID order. The fixture contains one qualifying account, alex_brown, while every other account is active.
Success check
1 user — alex_brown (Australia, inactive)
Expected result
Use this output to verify values, aliases, ordering, and row count.
| user_id | username | country | status | |
|---|---|---|---|---|
| 5 | alex_brown | alex@email.com | Australia | inactive |
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.
Netflix
Independent Netflix-style streaming, subscription, catalog, ratings, and engagement SQL practice.
Airbnb
Independent Airbnb-style marketplace, booking, listing, payment, review, and guest analytics SQL practice.
Return to the complete interview preparation experience.