50 Solved Queries with Output
For FAANG + Data Analyst Interviews
2024 Edition
Instant Download
TABLE OF CONTENTS
1. Basic Queries & WHERE Clause: Q1-Q10
2. JOINs & Subqueries: Q11-Q20
3. Aggregation & GROUP BY: Q21-Q30
4. Advanced SQL - Window Functions: Q31-
,Q40
5. FAANG Hard Level Questions: Q41-Q50
HOW TO USE THIS PDF TO CRACK YOUR
INTERVIEW:
1. Try solving each question yourself first
without looking at solution.
2. Check the query + line-by-line explanation to
understand the logic.
3. Run the query on sample data given to verify
the output.
4. Memorize the pattern. 80% interviews ask
same patterns with different names.
5. Practice daily. 5 questions per day =
Interview ready in 10 days.
Pro Tip: FAANG interviewers care about
"EXPLANATION" more than code.
Read explanation of each question twice.
, BASIC QUERIES & WHERE CLAUSE: Q1-
Q10
Q1: Second Highest Salary
Difficulty: Easy | Asked in: Amazon, Bloomberg
Table: Employee
+----+--------+
| Id | Salary |
+----+--------+
| 1 | 100 |
| 2 | 200 |
| 3 | 300 |