Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

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

Brenna Hyland
Brenna Hyland
1,774 Points

Hello! Confused by the following error: "Bummer: Was expecting 4 entries in the products table. There's only 3"

Hello!

I am unsure as to why I am receiving the following error message and have tried multiple ways of typing this out. I ran into a similar one in the immediately following problem (just for 11 vs 10 not 4 vs 3). What am I missing on this in terms of my code? How do I go about rectifying this?

Thank you!

4 Answers

Can you post your SQL? The error message you have received indicates no record was added to the products table. The table already contains 3 records and if successful your record would be the 4th.

Brenna Hyland
Brenna Hyland
1,774 Points

Thank you so much!

INSERT INTO products (id, name, description, price) VALUES (NULL, Tesla, car, 1000);

Where did I go wrong? Thanks!

You should assume name and description are text and as such their values should be enclosed in quotes.

 INSERT INTO products (id, name, description, price) VALUES (NULL, 'Tesla', 'car', 1000);

It needs to be single quotes (') too, not double-quotes(").

Brenna Hyland
Brenna Hyland
1,774 Points

Oh no! I feel so dumb. Thank you for your help! I was under the impression the addition of quotes was just for more than 1 word.

Thank you so much for your quick help!

Bruce Crighton
Bruce Crighton
1,253 Points

INSERT INTO products (id, name, description, price) VALUES (NULL,'green', 'crisps', 1.99);