MySQL Database rules

Source: Internet
Author: User

Database column type

varchar string

Bit Bohr type
int integer
float decimal
Char character
DateTime date time does not fit need to turn down
Text binary/string (no length limit)

Relationship

1. Primary key

2. Self-growth column

3. Foreign key

From the table
Main Table
Master Table control from table
The foreign key column in the primary table must be a primary key

Rules:

First paradigm: Guaranteeing the atomicity of each column

Second paradigm: Ensure that each column of a data table is associated with a primary key

Third paradigm: Ensure that each column of the data table is directly related to the primary key

Splitting a table until it cannot be split

Table name prefixed with lowercase

If the primary key is not found, use the self-growing column

Foreign key relationships can be used without adding

MySQL Database rules

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.