(explanatory text) Relationship between primary key 0 and primary key self-draining constraints in My SQL

Source: Internet
Author: User
The last one we said about self-draining if the primary key is 0, here I figure out why, cause this is because the initial value is set in SQL for the self-row:


From here you can see that the two variables, one is the increment of the initial value, one is incremental, here is 1, so when the setting of self-increment will be that field of the original existence of all 0 to the beginning of the 1 step 1 of the arithmetic progression.  However, this value can be modified (but not recommended here), if the insert is inserted at the time of 0, it will default to insert the line number, or the default value automatically becomes the line number. First we have to understand that the primary key from the row, why to use the primary key self-platoon, not because of the subsequent indexing and other convenient operation, so here will be inserted with the line number to change 0 completely reasonable.

(explanatory text) Relationship between primary key 0 and primary key self-draining constraints in My SQL

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.