Backend development

Stage 2 · Lesson 1 of 10

Queries and joins

Relational databases and SQL

Start by reading data from tables that already exist. SELECT picks the columns, WHERE filters the rows, ORDER BY sorts them and LIMIT caps how many come back. Then learn , which combine tables by matching their keys.

An INNER JOIN keeps only rows that have a match on both sides. A LEFT JOIN keeps every row from the left table, and fills in where there is no match. "Customers with their orders" is an inner join.

"Customers who have never ordered" is a left join, filtered with WHERE o.id IS NULL. Practise on with a real dataset.

Common trapNULL, which means "unknown": comparing anything with NULL gives unknown rather than true or false, so WHERE discount <> 10 silently skips rows where discount is NULL.

A question to check yourself, an AI practice session and 1 cheat sheet entry come with the full roadmap. Unlock

Resources for this stage

Start with· follow one of these

Practise

Also worth your time

Mark this stage as not done?