// free study notes

SQL interview questions and answers

Worked questions grouped by topic and tagged easy, medium or hard. Every answer is a real query with the reasoning written out. Read a topic, then use practice mode to test yourself on it.

Every question at a glance

Each link opens the question on its topic page with the worked answer underneath.

SQL interview questions FAQ

Are these SQL interview questions free?

Yes. Every topic page, every worked answer and the practice mode are free, with no sign-up. SQLly makes a desktop SQL workbench, and these pages are the notes we would want before a SQL screen.

What SQL dialect are the answers in?

Standard SQL where it exists. Dialect-specific examples are PostgreSQL unless marked otherwise, and the answers name the SQL Server, MySQL and SQLite spelling where they differ: limit clauses, date truncation, string aggregation, recursive CTE syntax and QUALIFY.

How many questions are there, and how are they organized?

More than 80 questions across seven topics: basics, joins, aggregation and HAVING, window functions, subqueries and CTEs, indexes and performance, and schema design. Each question is tagged easy, medium or hard.

What is practice mode?

A quiz view that draws from every question in the catalog, shows the question first and reveals the worked answer on click. You can shuffle the deck and filter by difficulty. It runs in your browser and keeps answered state in memory, so a reload starts over.

What level are these questions for?

Easy questions are junior warm-ups, medium questions are the standard mid-level screen, and the hard ones are the senior follow-ups: frame traps, recursive CTEs, join flattening and hierarchy storage.

// from study notes to daily tool

Now write some SQL against a real database

SQLly is a native SQL workbench for macOS, Windows and Linux: IntelliSense that knows your schema, a formatter, guardrails for risky queries, and every engine in one app.