MySQL Interview Questions 2026, 35 Q&A on Indexes, Joins, and Tuning

What changed in 2026 drives
Mass-recruiter offer letters are flatter for 2026 batch - the 4-5 LPA ASE band has barely budged in three years while inflation eats real wages. Premium tracks (Digital, Pro, Elite, Specialist) are still where the differential lives, and they are entirely test-driven. If you are aiming higher than the default offer, the coding round is not optional pageantry - it is the entire interview.
What I'd actually study for this
- 01Two solid coding-round answers (1 medium-hard DSA each, with edge-case discussion) > five half-baked ones
- 02One real project you can defend end-to-end - file paths, design decisions, and what you would change
- 03One DBMS schema you actually built (not a textbook ER diagram), with at least 3 join-heavy queries written from memory
- 04Three behavioural STAR stories: failure recovered, conflict handled, ownership taken
Where most candidates trip up
The single biggest mistake is treating company-specific guides as primary prep and DSA as secondary. It is the opposite. Mass recruiters use the test as a filter, but premium tracks at every IT services company use coding to allocate offer band. Spend 70% of prep time on DSA + system fundamentals, 20% on company-specific patterns, 10% on HR rehearsal. Reverse that ratio and you collect the default offer.
Editorial commentary by Aditya Sharma · written for PapersAdda · not generated, not aggregated.
MySQL is one of the most common relational databases in India's backend interviews, and candidates report joins and indexing decide the round. Interviewers probe SQL fluency, index strategy, transactions and isolation, and query optimization with EXPLAIN. This guide compiles 35 questions from candidate-reported rounds and public preparation resources, each with SQL and the trade-off being tested.
The skill: can you write a correct multi-table query and reason about how MySQL executes it? That is the bar.
Related: PostgreSQL Interview Questions 2026 | MongoDB Interview Questions 2026 | Node.js Interview Questions 2026 | REST API Interview Questions 2026
SQL Fundamentals (Q1 to Q12)
Q1. What are the types of JOINs in MySQL?
| Join | Returns |
|---|---|
| INNER JOIN | Rows matching in both tables |
| LEFT JOIN | All left rows, matched right or NULL |
| RIGHT JOIN | All right rows, matched left or NULL |
| CROSS JOIN | Cartesian product |
| Self join | A table joined to itself |
MySQL has no FULL OUTER JOIN; emulate it with a UNION of LEFT and RIGHT joins.
Q2. What is the difference between WHERE and HAVING?
SELECT dept, COUNT(*) c FROM emp GROUP BY dept HAVING c > 5;
Q3. What is the difference between DELETE, TRUNCATE, and DROP?
| DELETE | TRUNCATE | DROP | |
|---|---|---|---|
| Removes | Rows (with WHERE) | All rows | Table itself |
| Transaction | Yes (rollbackable) | Minimal logging | DDL |
| Resets auto-increment | No | Yes | N/A |
| Speed | Slower | Fast | Fast |
Q4. What are the types of indexes in MySQL?
Q5. How does a clustered index differ from a secondary index in InnoDB?
Q6. What is a covering index?
Q7. What is normalization and the normal forms?
Q8. What is the difference between CHAR and VARCHAR?
Q9. What are aggregate functions?
Q10. What is the difference between UNION and UNION ALL?
Q11. What are subqueries and when do you use them?
Q12. What is a foreign key and what does it enforce?
Transactions and Optimization (Q13 to Q24)
Q13. What are ACID properties?
Q14. What are the transaction isolation levels?
| Level | Prevents |
|---|---|
| READ UNCOMMITTED | Nothing (dirty reads possible) |
| READ COMMITTED | Dirty reads |
| REPEATABLE READ (default) | Dirty and non-repeatable reads |
| SERIALIZABLE | All anomalies (most locking) |
InnoDB's REPEATABLE READ uses MVCC and gap locks to also prevent most phantom reads.
Q15. What are dirty, non-repeatable, and phantom reads?
Q16. What is MVCC?
Q17. What is a deadlock and how does MySQL handle it?
Q18. How do you read EXPLAIN output?
Q19. Why might an index not be used?
Q20. What is the leftmost-prefix rule for composite indexes?
Q21. How do you paginate efficiently in MySQL?
Q22. What is the difference between a stored procedure and a function?
Q23. What is a trigger?
Q24. How do you optimize a slow query?
Architecture and Scaling (Q25 to Q35)
Q25. What is the difference between InnoDB and MyISAM?
| InnoDB | MyISAM | |
|---|---|---|
| Transactions | Yes | No |
| Locking | Row-level | Table-level |
| Foreign keys | Yes | No |
| Crash recovery | Yes (redo log) | Weaker |
| Default | Yes (since 5.5) | Legacy |
InnoDB is the right default for almost all workloads.
Q26. How does MySQL replication work?
Q27. What is read-write splitting?
Q28. What is sharding and when do you need it?
Q29. What is the difference between vertical and horizontal partitioning?
Q30. What is the binary log used for?
Q31. How do you back up MySQL?
Q32. What causes high CPU on a MySQL server?
Q33. What is connection pooling and why does it matter?
Q34. Scenario: a query is fast in dev but slow in production. Explain possible causes.
Q35. How do you prevent SQL injection?
MySQL Mock Test, 2026 Edition
5 original questions calibrated to the 2026 MySQL batch by Aditya Sharma, from candidate-reported patterns.
Question 1
In InnoDB, the primary key is:
a) a secondary index b) the clustered index holding row data c) optional d) table-level only
Solution: InnoDB orders rows physically by the primary key. Answer: (b)
Question 2
A composite index (a, b, c) does NOT serve a query filtering on:
a) a b) a and b c) b alone d) a, b, c
Solution: The leftmost-prefix rule excludes b alone. Answer: (c)
Question 3
The default InnoDB isolation level is:
a) READ UNCOMMITTED b) REPEATABLE READ c) SERIALIZABLE d) READ COMMITTED
Solution: InnoDB defaults to REPEATABLE READ. Answer: (b)
Question 4
EXPLAIN type = ALL means:
a) covered query b) a full table scan c) index used d) range scan
Solution: ALL indicates no usable index; a full scan. Answer: (b)
Question 5
Keyset pagination beats LIMIT offset because:
a) it is simpler b) it avoids scanning skipped rows c) it sorts faster d) it caches
Solution: Large offsets still scan the skipped rows. Answer: (b)
FAQ, MySQL Interview Questions
Q: How deep are joins tested? Very. Candidate-reported rounds almost always include a multi-table join, often with aggregation and a tricky LEFT JOIN edge case.
Q: Do I need EXPLAIN for freshers? Basic EXPLAIN awareness helps even for freshers; deep plan reading skews mid to senior.
Q: MySQL or PostgreSQL to learn first? Either; the SQL fundamentals transfer. MySQL is extremely common at India product companies. Confirm the stack on the official company careers page.
Q: What is the most-missed MySQL concept? Why an index is not used (non-sargable predicates) and large-offset pagination, per candidate-reported feedback.
You May Also Like
Methodology applied to this articlelast verified 8 Jun 2026
- No fabricated salary numbers or success rates. If we quote a range, it's sourced.
- No noun-substituted templates. This article was not generated by swapping company names in a stock prompt.
- No paid placements, sponsored coaching links, or affiliate-shilled course pushes.
Explore this topic cluster
More resources in Interview Questions
Use the category hub to browse similar questions, exam patterns, salary guides, and preparation resources related to this topic.
Paid contributor programme
Sat this this year? Share your story, earn ₹500.
First-person experience reports help future candidates prep smarter. We pay verified contributors ₹500 via UPI per accepted story - with byline.
Submit your story →Ready to practice?
Take a free timed mock test
Put what you learned into practice. Our mock tests match the 2026 pattern with timer, navigator, reveal, and score breakdown. No signup.
Start Free Mock Test →Related Articles
Airbnb Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing Airbnb's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical, behavioural,...
Airtel Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing Airtel's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical, behavioural,...
AMD Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing AMD's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical, behavioural,...
Atlassian Interview Questions 2026: Top Tech, HR & Behavioural Q&As for Freshers
Clearing Atlassian's fresher loop in 2026 comes down to preparing for the exact mix of questions across technical,...
Barclays Interview Questions 2026
_Last verified by [Aditya Sharma](/author/aditya-sharma/) · cross-checked against PapersAdda Hiring Pulse and...
More from PapersAdda
Accenture Interview Process 2026: Rounds & Prep
Accenture Interview Questions 2026 (with Answers for Freshers)
Adobe Interview Process 2026: Rounds, OA & Aptitude
Amazon Interview Process 2026: Full Loop + Bar Raiser