Learn with Abdou

Chapter 9 · Concept 2 of 6 · Practice

Add a row that fits

INSERT with named columns, defaults, a parent that exists · level 1 of 6

Opening your saved work…

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

Add a row that fits · INSERT with named columns, defaults, a parent that exists · level 1 of 6

A new tea on the menu

Level 1: Watch it answered · Exercise 1 of 1

Add a Large Chai Latte at 5.50 to the Tea category. Watch the statement, run it, and look at the row it made.

Data: Northshore Coffee. Every run starts from a fresh copy, so nothing you try here is permanent.

Why it works, clause by clause

  1. INSERT INTO menu_items (name, category, size, price): the columns, named, in the order the values will come.
  2. VALUES ('Chai Latte', 'Tea', 'Large', 5.50): one value per named column, text in quotes.
  3. No id: INTEGER PRIMARY KEY hands out 46. No calories, is_seasonal or description: those columns get NULL.

From the reading: Add a row that fits, paragraph 1

The queryOpening the database…
INSERT INTO menu_items (name, category, size, price)
VALUES ('Chai Latte', 'Tea', 'Large', 5.50);
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.