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
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
- INSERT INTO menu_items (name, category, size, price): the columns, named, in the order the values will come.
- VALUES ('Chai Latte', 'Tea', 'Large', 5.50): one value per named column, text in quotes.
- 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
INSERT INTO menu_items (name, category, size, price)
VALUES ('Chai Latte', 'Tea', 'Large', 5.50);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.