Prime Member List
Which customers hold an active Prime membership?
- Filtering
Challenge brief
Understand the request
Prime Growth Team needs a list of all active Prime subscribers to target with a loyalty promotion.
List all customers who hold an active Prime membership.
Return
- first_name
- last_name
- country
Constraints
- Prime members are stored as prime_member = 1 in the customers table
- Non-Prime customers (prime_member = 0) must be excluded
Data you will use
Review the relevant tables before deciding how to join, filter, or aggregate them.
customers
first_nameVARCHAR(50)last_nameVARCHAR(50)emailVARCHAR(100)countryVARCHAR(50)prime_memberINTEGER
Hints, when you need them
Open one clue at a time so you still do the reasoning.
Hint 1
All the data you need — name, email, country, and membership status — is in a single table: customers. The prime_member column encodes membership as an integer: 1 = Prime, 0 = Non-Prime.
Hint 2
Use a WHERE clause to keep only rows where prime_member equals 1. No JOIN is needed — everything is in one table.
Hint 3
Scaffold: SELECT the four requested customer fields FROM customers, then add the membership-flag predicate.
Verified SQL answer
Attempt the problem first, then compare structure and reasoning—not just syntax.
Reveal solution and explanation
SELECT first_name, last_name, email, country FROM customers WHERE prime_member = 1;Why this works
prime_member is stored as an integer flag (1/0). WHERE prime_member = 1 filters to exactly the 4 Prime customers. This is a single-table query — no JOIN required.
Success check
4 rows — all Prime members in the dataset
Expected result
Use this output to verify values, aliases, ordering, and row count.
| first_name | last_name | country | |
|---|---|---|---|
| Alice | Johnson | alice.j@email.com | USA |
| Bob | Smith | bob.s@email.com | USA |
| David | Brown | david.b@email.com | USA |
| Frank | Miller | frank.m@email.com | USA |
Learn the concepts behind this answer
Strengthen your understanding with these targeted learning topics:
Continue practicing
Explore related company challenges
Airbnb
Independent Airbnb-style marketplace, booking, listing, payment, review, and guest analytics SQL practice.
Uber
Independent Uber-style mobility marketplace SQL practice covering trips, drivers, riders, pricing, payments, and promotions.
Microsoft
Independent Microsoft-style cloud, productivity, subscription, usage, support, and customer analytics SQL practice.
Return to the complete interview preparation experience.