Premium course
MySQL
PostgreSQL
8 hours

SQL for interviews

Stop fearing the blank screen in a coding interview. A small set of patterns covers most SQL tasks — learn to spot them in the wording and pull out a ready-made query skeleton.

  • You read the statement and see the construct at once, even on an unfamiliar task
  • You solve in minutes what looks unsolvable without practice
  • You walk into the interview confident — every pattern already solved ten ways
12 lessons
Certificate upon completion

This course is part of Premium — along with the other advanced courses, the AI assistant and certificates.

interview.sql
-- For each department — the employee with the highest salary
-- pattern: recognizing…

What changes after the course

Now
After the course
You read the statement and don't know where to begin the query
You recognize the pattern by its signal words and pull out the skeleton at once
"Second-highest salary" and "latest order" feel like different problems
You see the single shape behind them: numbering rows within a group
You wrote the first query but stumbled on the NULL and duplicates follow-up
You know the typical traps in advance and close them before you're asked
You prep on scattered LeetCode tasks with no system
You go through a dozen patterns that cover most interviews

Course curriculum

Each lesson is short theory with runnable examples plus practice in the trainer with automatic checking.

01
SQL on interview: recognize the task at a glance
How to read a problem statement, catch the signal words, and recognize the shape of the solution. The method explained on three real interview tasks.
02
How many in total and how many of them
Count several metrics with different conditions in one pass using SUM(CASE) and FILTER. We break down the follow-up questions on COUNT, NULL and HAVING.
03
Who never did: anti-join
Find rows with no matching pair: who never did something. NOT EXISTS versus LEFT JOIN, and why NOT IN silently breaks on NULL values.
04
A table against itself: self-join
Join a table to itself to compare a row with another row: employee and manager, pairs of colleagues. Why the id < id condition removes duplicates.
05
The second, fifth, Nth largest
The window ranks ROW_NUMBER, RANK and DENSE_RANK, and why «the second highest salary» is not solved by MAX or LIMIT OFFSET.
06
The best row in each group
When the task asks for a whole row rather than a number: each customer's biggest order, each employee's latest one, the top earner per department. Why MAX and GROUP BY fall short, how ROW_NUMBER with PARTITION BY solves it, and why ties call for RANK. The same trick deduplicates rows.
07
A sum from one table, a count from another
When you join two related tables and aggregate, the JOIN multiplies rows and SUM and COUNT get inflated. How to spot fan-out and count correctly with pre-aggregation.
08
Previous row and running total
chapterDescriptions.window-time
09
Consecutive streaks of days
The longest streak of consecutive days sounds like a loop problem but is solved with arithmetic: the gaps-and-islands trick using row numbering and subtraction.
10
Median: the typical value, not the average
SQL has no MEDIAN function. Compute the median with PERCENTILE_CONT in PostgreSQL and by hand with window functions in MySQL, handle the even-row-count trap, and see why the median beats the average.
11
Break an unfamiliar task into familiar pieces
The course wrap-up: a hard task is just a few simple ones stacked with WITH. A composite task walkthrough, a marker-to-pattern recognition map, and interview strategy.
12
Exam: recognize the pattern
Final check: five tasks on the most common patterns, shuffled and with no hint which chapter they belong to. Recognize the pattern from the wording and recall its skeleton, just like in a real interview.

How the learning works

01

Read a lesson with live examples

No-fluff theory: every query in a lesson can be run and tweaked right in your browser.

02

Solve exercises on a real database

You write SQL in the trainer and your answer is automatically checked against a real database. Nothing to install.

03

Stuck? The AI mentor helps

The built-in assistant points out what's wrong with your query and nudges you towards the solution without giving it away.

Who this course is for

Analysts and backend developers

For those who write SELECT confidently but freeze in an interview when a simple wording hides a familiar query shape.

QA engineers

The SQL section in a QA interview is a common barrier. Here you cover the exact task types they ask about and stop guessing.

Students before an internship

A first technical interview almost always includes SQL. Finish the course and walk in having solved every pattern ten different ways.

You'll need solid basic SQL — SELECT, JOIN, GROUP BY. If you don't have it yet, start with the free course.

A certificate you can verify

Complete all lessons and receive a personalized course certificate. Attach it to your CV or LinkedIn profile.

A certificate you can verify
Your name and the course title
QR code and verification link

What learners say

Anna
Anna
After completing the course, I got promoted to data analyst. The course paid for itself in just one working day with my new salary!
Nikolay
Nikolay
Excellent presentation of the material! Very pleased with tasks from interviews at large IT companies.
Liza
Liza
The site is great! Tasks are interesting, UX is at a high level! Verification based on query results, not the query itself like on other sites.

One Premium — all courses at once

You're not buying a single course but the whole SQL Academy Premium: three advanced courses and every trainer feature.

  • Access to advanced SQL courses
  • Unlimited hints from AI Assistant
  • Access to tasks from top company interviews
  • Access to reference solutions for tasks
  • Certificates proving your SQL knowledge
$ 36,90
6-month access, no auto-renewal

Secure card payment via Stripe. Access opens immediately after payment.

FAQ

Who is this course for?

Anyone preparing to face SQL in an interview: analysts, backend developers, QA engineers and students before an internship.

How is this different from the trainer tasks?

The trainer gives you tasks; the course gives you a system for recognizing them. You learn to see the familiar pattern behind the wording and return to the trainer with an approach in hand, not a guess.

Do I need to install a database?

No, everything runs in the browser — nothing to set up.

Is my SQL good enough?

You need solid basic SQL: SELECT, JOIN, GROUP BY. Window functions are recapped along the way, but not from scratch — if the syntax is new to you, start with the free course first.

Can I get a certificate?

Yes, after completing all lessons you receive a personalized certificate.

What's included in premium besides this course?

All advanced courses — query optimization, SQL for data analysis and database design — plus the AI assistant, interview tasks from top companies, reference solutions and certificates.

Log in to your account
Log in to access the course.
Log in