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

Development Tools

Can I INSERT an entry with a primary key into a table if previously there was an entry with same primary key deleted?

Here's the example: I have a table called Products. I have an entry with a primary key of "4". I delete the entry with primary key of "4". Can I now add an entry with primary key of "4"?

1 Answer

Navid Mirzaie Milani
Navid Mirzaie Milani
6,274 Points

Fred Lawton yes you can :) , however if your table field is set to auto_increment you don't need to set an id, but if you still want to set it you free to do so.