SQL & Database Interview Questions
Free, no-signup interview preparation for SQL and database roles — real questions with detailed, worked answers, not flashcards. Each set below covers the questions you're most likely to be asked in technical screens and onsite interviews, with SQL you can copy straight into SQLMentor's free SQL editor and run.
These aren't generic trivia lists. Every answer explains the reasoning — why RANK() and DENSE_RANK() diverge on ties, why a correlated subquery differs from a JOIN, why NULL breaks a JOIN condition — because that's what interviewers actually probe for.
Interview question sets
Oracle SQL Interview Questions
15 of the most commonly asked SQL interview questions — WHERE vs HAVING, window functions, the Nth-highest-salary problem, correlated subqueries, deduplication, ACID, indexes, SQL injection, joins, normalization, CTEs, and NULL handling. Written for Oracle syntax but the concepts apply to any SQL dialect.
IBM DB2 Interview Questions
30 questions spanning beginner fundamentals through DBA-level troubleshooting — MERGE, isolation levels, RUNSTATS, clustering indexes, deadlocks, BLU Acceleration, and real scenario questions like "a query that ran in 200ms yesterday now takes 30 seconds."
PL/SQL, PostgreSQL & SQL Server
Dedicated interview question sets for PL/SQL, PostgreSQL, and SQL Server / T-SQL are in progress. In the meantime, the Oracle SQL set above covers concepts — joins, window functions, CTEs, indexing — that carry directly across every dialect.
How to use these question sets
- Read the question and try to answer it out loud before revealing the answer
- Run every example query in the free SQL editor against the live HR schema — seeing real output cements the concept far better than reading it
- Pay attention to the "why," not just the "what" — interviewers follow up on reasoning
- Pair the Oracle set with the 1Z0-071 practice exam if you're also preparing for certification