MySQL Database First day

Source: Internet
Author: User

LAMP linux Apache MySQL PHP relational Server Software "server" database operation

MySQL common data type: int varchar float DOUBLE bit datetime ...

varchar specified length, no matter how long the content is, the actual length is less than or equal to the specified length

char specifies the length, regardless of the length of the content, which is the specified length

General experience in building a table: classification, layering, step-by

1. Classification

2, MN Relationship: A pair of one or one-to-many, many-to-many

Primary key, foreign key.

I. Entity integrity:
Primary key: Unique, required, sorted; Only one primary key per table. Single column, combined columns.
Self-growth: must be a number, the system automatically increases.
Default value: If you do not fill in the default values are populated, if filled with the filled values are saved.
Non-null constraint:


Second, quote the full
Foreign keys: Two tables (Main table, from table), built on the table.
Main Table: A table used to constrain others
From tables: constrained tables.
The Master-slave table is only meaningful for the specified two tables

MySQL Database First day

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.