If I had 30 minutes to test your SQL, I'd ask:
1. Find duplicate rows
2. Customers with no orders
3. Second highest salary
4. Running total by month
5. Latest order per customer
6. Month-over-month growth %
7. Why is this query slow?
How many can you do without Googling?
SQL INTERVIEW QUESTION #3
Why does this fail?
SELECT department, AVG(salary)
FROM employees
WHERE AVG(salary) > 50000
GROUP BY department;
And what's the fix?
Reply with your answer.
Answer #3: WHERE filters rows before grouping, so it can't use AVG(). Filter groups with HAVING:
SELECT department, AVG(salary)
FROM employees
GROUP BY department
HAVING AVG(salary) > 50000;
WHERE = rows. HAVING = groups.
Use AI for Excel formulas the right way:
1. Describe your columns: "A = date, B = region, C = sales"
2. Say the result you want in plain English
3. Ask for the formula AND a one-line explanation
4. Test it on 5 rows you can check by hand
Step 4 is the one people skip.
Every student hits this one
"must appear in the GROUP BY clause" ๐ฉ
GROUP BY drops rows into buckets. Each bucket becomes ONE row, so every SELECT column must be in GROUP BY or inside a function.
#sql #learnsql #dataanalyst #sqlforbeginners #datascience #studentlife
Get SQL Mastery Guide here ๐
techiesverse.gumroad.com/l/dโฆ
Learning Python for work from zero? Start here: techiesverse.gumroad.com/l/aโฆ
INNER JOIN vs LEFT JOIN, clearly explained:
INNER JOIN: only customers who placed an order.
LEFT JOIN: every customer. No order? The order columns come back NULL.
Rule of thumb: if you need "who did NOT do X", start with a LEFT JOIN.
Learning SQL from zero? Our SQL course:
techiesverse.gumroad.com/l/dโฆ
SQL INTERVIEW QUESTION #2
users has 10 rows. 3 of them have email = NULL.
SELECT COUNT(*), COUNT(email)
FROM users;
What two numbers come back?
A) 10, 10
B) 10, 7
C) 7, 7
Reply with your answer.
Answer #2: B) 10, 7
COUNT(*) counts rows. COUNT(email) counts only non-NULL emails.
Same trap with AVG(col): NULLs are skipped, not treated as 0. That can quietly change your averages.
Messy spreadsheet? Don't ask AI to clean it. Ask it to write the cleaning script.
Paste 10 sample rows and say:
"Write a pandas script that trims spaces, fixes date formats and removes duplicate rows. Explain each step."
Now it works on 10 rows or 100,000.
Comment "SQL" and I'll send you the full guide ๐
Your class average says 82. It's really 66 ๐ณ
AVG skips NULLs, so the 4 absent students just vanished.
โ
Fix: AVG(COALESCE(score, 0))
The SQL Mastery Guide covers every trap like this: 24 modules, 250+ labs, one Notion
Get SQL Mastery Guide here ๐
techiesverse.gumroad.com/l/dโฆ




