Learn with Abdou

Chapter 2 · Concept 1 of 6 · Practice

Meet the table

SELECT, FROM, ORDER BY id and LIMIT as a preview · level 1 of 6

Opening your saved work…

Sign in to save across devices → · Download your guest work before switching accounts.

Meet the table · SELECT, FROM, ORDER BY id and LIMIT as a preview · level 1 of 6

The first five lines

Level 1: Watch it answered · Exercise 1 of 2

What does one row of scripts look like? Watch the preview answer it, then run it and read the first row aloud.

Data: Rick & Morty.

Why it works, clause by clause

  1. SELECT *: every column. For a first look at a table you do not know yet, that is the right choice.
  2. FROM scripts: the one table in this database.
  3. ORDER BY id: the same five lines every time. Without it, first five means whichever five the engine reached first.
  4. LIMIT 5: a preview, not an answer. The table has 1,905 lines; you are looking at five of them.

From the reading: One row is one spoken line, paragraph 1

The queryOpening the database…
SELECT *
FROM scripts
ORDER BY id
LIMIT 5;
Open in the playground

Query results

Run it to see the result here.

Run it to see the result here.

Practice here is evidence for you and your instructor, never a grade. Grades live in Canvas.