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

Why is it 11 not 10?

Im inputing the right amount of values...

Steven Parker
Steven Parker
228,978 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
228,978 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
228,978 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
228,978 Points

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

Happy coding!