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."
Oracle PL/SQL Interview Questions
20 questions on Oracle's procedural language — block structure, %TYPE vs %ROWTYPE, implicit vs explicit cursors, exception handling, packages, triggers and the mutating-table error, BULK COLLECT/FORALL, autonomous transactions, and dynamic SQL.
PostgreSQL Interview Questions
16 questions covering what interviewers actually probe in PostgreSQL — MVCC, VACUUM & autovacuum, JSONB vs JSON, the index types (B-tree/GIN/GiST/BRIN), upserts with ON CONFLICT, LATERAL joins, isolation levels, and table partitioning.
SQL Server (T-SQL) Interview Questions
16 questions on the Microsoft stack — clustered vs non-clustered indexes, covering indexes, temp table vs table variable vs CTE, TRY...CATCH, MERGE, CROSS/OUTER APPLY, isolation levels & NOLOCK, IDENTITY vs SEQUENCE, and parameter sniffing.
SQL Interview Questions for Freshers
16 foundational questions pitched at 0-2 years of experience — SQL basics, primary/foreign keys, joins, DELETE vs TRUNCATE vs DROP, normalization, and NULL handling, explained simply.
SQL Interview Questions for Experienced Professionals
14 scenario-based questions for 5+ year engineers — diagnosing a slow query, resolving a production deadlock, partitioning strategy, zero-downtime migrations, and code-review judgment calls.
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