Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

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

Mohammed El-Zein
Mohammed El-Zein
2,753 Points

Was expecting 7 entries not 6.

keeps saying error don't know why

Zack Mowrer
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Zack Mowrer
Full Stack JavaScript Techdegree Graduate 62,350 Points

In which step does this error occur (eCommerce table, user table, or phone contact list)? Could you please show us the SQL code that you are trying to use?

Mohammed El-Zein
Mohammed El-Zein
2,753 Points

INSERT INTO phone_book (id, first_name, last_name, phone) VALUE (NULL, "MO", "EL-ZEIN", "123456")

1 Answer

Zack Mowrer
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Zack Mowrer
Full Stack JavaScript Techdegree Graduate 62,350 Points

You need to use VALUES, not VALUE, when inserting data into a table. Also, I would set the id to some integer rather than NULL.

INSERT INTO phone_book (id, first_name, last_name, phone) VALUES (15, "MO", "EL-ZEIN", "123456")