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

Why is it 11 not 10?

Im inputing the right amount of values...

Steven Parker
Steven Parker
216,135 Points

To facilitate analysis and an answer, please show your complete query, and provide a link to course page you are working with (or at least name the course, stage, and which video/challenge/quiz).

5 Answers

Steven Parker
Steven Parker
216,135 Points

The first of the values is "NULL" — the quotes make it a string literal and therefore not the appropriate type for that column. You probably intended to use NULL (no quotes) to indicate that no value was being supplied (since it's an auto-increment column).

Another way to handle auto-increment columns is to leave them out of the column list and values list entirely. So you could also write:

INSERT INTO users ("username", "password", "first_name", "last_name")
  VALUES ("weirdo", "fungus", "robert", "barker");

its in task challenge 2

Steven Parker
Steven Parker
216,135 Points

The link will help. Please also provide the complete query code you were submitting for task 2.

INSERT INTO users ("id", "username", "password", "first_name", "last_name") VALUES ("NULL", "weirdo", "fungus", "robert", "barker");

Hey thanks buddy that works! Really appreciate the help.

Steven Parker
Steven Parker
216,135 Points

Matthew DeFalco — Glad to help. You can mark the question solved by choosing a "best answer".

Happy coding!