These are SQL questions of the kind Apple actually asks — the patterns reported from Apple's SQL screens and data/SDE interview rounds. My advice: treat this page as a mock test. Attempt every question on paper first, then reveal. If any answer surprises you, the lesson it comes from is linked right below — go read it, then come back.
Apple SQL concept questions
What is a foreign key, and how does a foreign key constraint help maintain data integrity? Give an example.
Asked in
Apple SQL query questions
Given the reviews table, write a query to compute the average star rating for each product, month by month, rounded to 2 decimals.
Asked in
reviews5 rows
| review_id | product_id | stars | submit_date |
|---|---|---|---|
| 1 | 50001 | 4 | 2026-06-08 |
| 2 | 50001 | 5 | 2026-06-10 |
| 3 | 50001 | 3 | 2026-07-01 |
| 4 | 69852 | 4 | 2026-06-18 |
| 5 | 69852 | 2 | 2026-07-26 |
Given the icloud_usage table, find users who use more than 50 GB in total across at least 2 different device types, ordered by total storage descending.
Asked in
icloud_usage7 rows
| user_id | device_type | storage_gb |
|---|---|---|
| 1 | iphone | 30.0 |
| 1 | mac | 35.0 |
| 2 | iphone | 80.0 |
| 3 | iphone | 20.0 |
| 3 | ipad | 15.0 |
| 4 | mac | 60.0 |
| 4 | iphone | 5.0 |
How to use this page: Apple rarely asks a question you've never seen — they ask standard patterns with a twist. Master the pattern in the SQL course lessons, and the twist stops mattering.
Keep practising: SQL Basics, Joins, GROUP BY & HAVING and Subqueries cover what most Apple SQL rounds test.

