These are SQL questions of the kind Meta actually asks — the patterns reported from Meta'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.
Meta SQL concept questions
List several concrete query optimization techniques a developer can apply, beyond simply adding indexes.
Asked in


Meta SQL query questions
Using the same employees table, and considering only employees hired on or after 2020-01-01, write a query to find departments whose average salary (among just those recently-hired employees) exceeds 65000. Show the department and that average salary, rounded to 2 decimal places.
Asked in


employees10 rows
| emp_id | name | department | city | salary | hire_date |
|---|---|---|---|---|---|
| 1 | Alice Sharma | Engineering | Mumbai | 95000 | 2019-03-12 |
| 2 | Bob Iyer | Engineering | Mumbai | 72000 | 2020-07-01 |
| 3 | Chitra Rao | Sales | Delhi | 65000 | 2018-11-20 |
| 4 | David Paul | Sales | Delhi | 58000 | 2021-01-15 |
| 5 | Esha Nair | Engineering | Bangalore | 88000 | 2019-09-05 |
| 6 | Farhan Khan | Marketing | Mumbai | 60000 | 2020-02-28 |
| 7 | Gita Menon | Marketing | Mumbai | 60000 | 2022-04-10 |
| 8 | Harish Verma | Sales | Bangalore | 72000 | 2022-06-18 |
| 9 | Amit Verma | Sales | Delhi | 52000 | 2021-08-01 |
| 10 | Isha Kapoor | Engineering | Mumbai | 95000 | 2023-01-10 |
Given the app_events table where event_type is either 'impression' or 'click', write a query to compute each app's click-through rate (CTR %) — clicks divided by impressions, times 100 — rounded to 2 decimals.
Asked in
app_events8 rows
| app_id | event_type |
|---|---|
| 1 | impression |
| 1 | impression |
| 1 | impression |
| 1 | click |
| 2 | impression |
| 2 | click |
| 2 | click |
| 3 | impression |
How to use this page: Meta 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 Meta SQL rounds test.

