Airbnb-style Company ChallengeBeginnerVerified answerSQLite live

US Guests

Return user_id and signup_date for users in the US (country = 'US'), ordered by user_id.

  • Filtering
  • Sorting

Challenge brief

Understand the request

Growth — North America The North America growth team is building a targeted US user segment for an upcoming campaign.

Find all users who signed up from the United States.

Return

  • user_id
  • signup_date

Constraints

  • Include only users whose country is 'US'
  • Order by user ID

Data you will use

Review the relevant tables before deciding how to join, filter, or aggregate them.

users

  • user_idINTEGER
  • countryVARCHAR(50)
  • signup_dateDATE

Hints, when you need them

Open one clue at a time so you still do the reasoning.

Hint 1

Country is stored with each user account.

Hint 2

Apply the country condition before projecting the output.

Hint 3

Use the user key to stabilize the result.

Verified SQL answer

Attempt the problem first, then compare structure and reasoning—not just syntax.

Reveal solution and explanation
SELECT user_id, signup_date FROM users WHERE country = 'US' ORDER BY user_id

Why this works

WHERE country = 'US' keeps only US registrations. signup_date is included so the growth team can see when each user joined.

Success check

Returns all and only US users in stable user order

Expected result

Use this output to verify values, aliases, ordering, and row count.

user_idsignup_date
12023-01-10
52023-05-05
72023-06-10

Learn the concepts behind this answer

Strengthen your understanding with these targeted learning topics:

Continue practicing

SQL Interview Practice

Return to the complete interview preparation experience.