Databases Modifying Data with SQL Adding Data to a Database Adding Data With SQL

What's wrong with this code???

INSERT INTO products (id, name, description, price) VALUES (null, `knife`, `slices`, 9.99)

need to insert a row of data in sql don't know why this won't work

I've tried it like this too:

INSERT INTO products VALUES (null, `knife`, `slices`, 9.99)

Says i inserted 3 and not 4 values or something.

Rich Donnellan
Rich Donnellan
Treehouse Moderator 25,637 Points

Question updated with code formatting. Check out the Markdown Cheatsheet below the Add an Answer submission for syntax examples.

1 Answer

53,705 Points

Enclose knife and slices in quotes.