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

confused

The same eCommerce database has a users table. It has the columns id, username, password, first_name, and last_name. Add a new user to the users table. Use any valid values you want. All columns are required. The id column is auto incrementing. (Don't enter a real password you'd really use!)

Steven Parker
Steven Parker
231,140 Points

Remember to sure to show your code, and provide a link to the course page you are working with.

2 Answers

Darrell Conklin
Darrell Conklin
22,099 Points
INSERT INTO users (id, username, password, first_name, last_name) VALUES (NULL, "myUsername", "pass1234", "myFirstName", "myLastName")

if you make the id column NULL it will assign it a number automatically because it's auto-incrementing

I'm not sure what issues you were having with that challenge but this is the answer

You don't need to add the id value explicitly, it should be added automatically.

INSERT INTO users (username, password, first_name, last_name) VALUES ("sspears@gmail", "pass222", "Stephanie", "Spears");