Flagship Store Locations
Which Apple stores are Flagship locations, and how many employees work at each?
- Filtering
- Sorting
Challenge brief
Understand the request
Retail Operations is benchmarking staffing levels and needs a list of all flagship stores with their headcount.
List all flagship Apple stores with store name, city, state, country, and employee count.
Return
- store_name
- city
- state
- country
- employee_count
Constraints
- Return Flagship stores only
- Show the largest employee counts first and resolve ties by store ID
Data you will use
Review the relevant tables before deciding how to join, filter, or aggregate them.
stores
store_idINTEGERstore_nameVARCHAR(100)store_typeVARCHAR(20)cityVARCHAR(50)stateVARCHAR(50)countryVARCHAR(50)employee_countINTEGER
Hints, when you need them
Open one clue at a time so you still do the reasoning.
Hint 1
All data is in a single table: stores. The store_type column identifies the type — filter to 'Flagship'. No JOIN required.
Hint 2
WHERE store_type = 'Flagship'. ORDER BY employee_count DESC.
Hint 3
Build question 3 from its business grain: identify the driving rows, add only valid relationships, then apply the required filtering, aggregation, and deterministic ordering.
Verified SQL answer
Attempt the problem first, then compare structure and reasoning—not just syntax.
Reveal solution and explanation
SELECT store_name, city, state, country, employee_count FROM stores WHERE store_type = 'Flagship' ORDER BY employee_count DESC, store_id ASC;Why this works
Single-table query. WHERE store_type = 'Flagship' excludes Apple Beverly Hills which is a 'Standard' store. All 5 remaining stores are Flagship.
Success check
5 flagship stores — Apple Fifth Avenue leads with 350 employees. Apple Beverly Hills (Standard) is excluded.
Expected result
Use this output to verify values, aliases, ordering, and row count.
| store_name | city | state | country | employee_count |
|---|---|---|---|---|
| Apple Fifth Avenue | New York | New York | USA | 350 |
| Apple Regent Street | London | England | UK | 320 |
| Apple Champs-Élysées | Paris | Île-de-France | France | 290 |
| Apple Union Square | San Francisco | California | USA | 280 |
| Apple Ginza | Tokyo | Tokyo | Japan | 260 |
Learn the concepts behind this answer
Strengthen your understanding with these targeted learning topics:
Continue practicing
Explore related company challenges
Microsoft
Independent Microsoft-style cloud, productivity, subscription, usage, support, and customer analytics SQL practice.
Google
Independent Google-style search, advertising, user-engagement, and video-product SQL practice.
Amazon
Independent Amazon-style e-commerce, warehouse, inventory, and customer analytics SQL practice.
Return to the complete interview preparation experience.