Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9054349
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T13:40:06+00:00 2026-06-16T13:40:06+00:00

I came across following sql statements and you can see that AUTO_INCREMENT is in

  • 0

I came across following sql statements and you can see that AUTO_INCREMENT is in two different places. Can you explain the different, I know the first one is auto incrementing id. But what does the second one mean?

CREATE TABLE `categories`(
    `id` int(11) NOT NULL AUTO_INCREMENT,
     `name` varchar(100) NOT NULL,
     `image_path` varchar(200) NOT NULL,
      PRIMARY KEY(`id`)
) ENGINE = InnoDB;

Second statement.

CREATE TABLE `categories`(
     `id` int(11) NOT NULL AUTO_INCREMENT,
     `name` varchar(100) NOT NULL,
     `image_path` varchar(200) NOT NULL,
     PRIMARY KEY(`id`)
) ENGINE = InnoDB  DEFAULT CHARSET = latin1 AUTO_INCREMENT=4 ;

I referenced http://dev.mysql.com/doc/refman/5.0/en/example-auto-increment.html. But I couldn’t find anything.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T13:40:07+00:00Added an answer on June 16, 2026 at 1:40 pm

    The AUTO_INCREMENT in the second statement sets the first number to be used in the id at 4.

    `id` int(11) NOT NULL AUTO_INCREMENT
    

    Sets the column name and tells the DB to auto increment the number when a new row is added.

    ) ENGINE = InnoDB  DEFAULT CHARSET = latin1 AUTO_INCREMENT=4 ;
    

    Sets the Engine used for the table, the charset and that it should start numbering at 4, not 1.

    CREATE TABLE explains this in a bit more detail.

    • AUTO_INCREMENT

    The initial AUTO_INCREMENT value for the table. In MySQL 5.0, this
    works for MyISAM and MEMORY tables. It is also supported for InnoDB as
    of MySQL 5.0.3.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I came across following code and don't know what does having from twice mean
I came across the following code that compiles fine (using Visual Studio 2005): SomeObject
I'm trying to optimize SQL queries in Akonadi and came across the following problem
I came across the following two lines in AndroidMenifest.xml file of my android application:
While studying SQL CLR stored procedure I came across following link Link for SQL
I came across the following SQL in a book: CREATE TABLE 'categories'( id SMALLINT
I came across the following SQL statement: SELECT A.NAME FROM THE_TABLE A WHERE A.NAME
While reading SQL Server documentation I came across the following statement: EXEC sp_addlinkedserver @server=N'S1_instance1',
I came across a rather strange problem with linq-to-sql. In the following example, var
I've came across strange issue. I know I'm missing something very minor. Can Any

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.