Examples
Tracing an SQL query, clause by clause
FROM, WHERE, ORDER BY and SELECT applied in the order SQL runs them, on a small table of students’ marks.
- 0:55
- Code problems
- Narrated by Erinome
- English
Made from a prompt
Trace this on students(name, marks) with Asha 92, Ravi 78, Meera 85: SELECT name FROM students WHERE marks > 80 ORDER BY marks DESC;
Video transcript
In this video, we trace an SQL query that filters and sorts student records.
Question one: SQL tracing. Trace this on students, name and marks, with Asha ninety-two, Ravi seventy-eight, Meera eighty-five.
FROM students reads the three rows. WHERE marks greater than eighty keeps only rows whose marks exceed eighty. Asha has ninety-two marks, so Asha stays.
Ravi has seventy-eight marks, so Ravi is excluded. Meera has eighty-five marks, so Meera stays. ORDER BY marks DESC sorts the remaining rows by marks, highest first.
Ninety-two comes before eighty-five, so Asha comes before Meera. SELECT name returns only the names, not the marks. Notice that sorting by marks does not require displaying marks.
Hence, the output is Asha followed by Meera.
More examples
-
How a neural network learns A network learning to spot cats: a guess, the error it gets back and a small correction, repeated, without a single equation. 1:25 · English -
Why the Moon seems to change shape Written from a NASA Space Place article: the half of the Moon the Sun always lights, and all eight phases in order. 0:59 · English -
كيف تجد قيمة س؟ A multiple-choice question written and narrated in Arabic: the equation is solved right to left in Arabic-Indic digits, every choice stays on the board, and the right one is circled in green. 1:07 · Arabic
Your topic, drawn in about a minute.
Your first 2 videos are free, up to 1 minute each, watermarked. No card required. Full product, every voice and style included.