MySQL database naming rules and conventions _ MySQL

Source: Internet
Author: User
MySQL database naming rules and conventions bitsCN.com

I. [operational specifications]
1. if there is no remark, the first id field in the table must be the primary key and automatically grow;
2. if there is no remark, use the UNSIGNED attribute for numeric fields;
3. if there is no remark, order_id is used by default in the program in descending order;
4. if there is no remark, all fields are set not null and the default value is set;
5. if there is no remark, a default value must be set for all Boolean fields, such as is_hot and is_deleted, and set to 0;
6. a default value must be set for all numeric fields and set to 0;
7. for varchar type field processing, please verify the user input, do not exceed its preset length;
8. when creating a table, write the Chinese name and attribute remarks of the fields in the data dictionary into the remarks of the data table ("PK, automatic growth" do not need to be written );
9. If no description is provided, the innodb engine is used for table creation;

II. common table name conventions]
0. note: The table prefix is abbreviated as the project name. Therefore, the table names are in lower case, separated by underscores (_), and words are in the singular form.
1. user

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.