MySQL Forums :: Newbie :: Automatic field in a table

Advanced Search

Automatic field in a table
Posted by: zahrah Land ()
Date: November 20, 2010 09:08AM


I made a table with the following command:
create table book(bookid int not null auto_increment, bookname varchar(50));

I tried to insert 8 books in this table and I managed to do that but I deleted them and that has been done successfuly. then I started adding a new book but the problem is when I write the command
select * from book;
I found my book but its bookid=9, although there is only one book in my table and the eigth previous books have been deleted. Why this is happeneing?? How can I start with 1 ? Is it because bookid automatic ?

Sorry for explain everything but I want the picture to be clear.
thanks in advance

Options: ReplyQuote

Subject Written By Posted
Automatic field in a table zahrah Land 11/20/2010 09:08AM
Re: Automatic field in a table Erik Haselhofer 11/20/2010 11:24AM
Re: Automatic field in a table Peter Brawley 11/20/2010 11:49AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.