A lot of types
1.varchar; string for name class, address, etc., general address 50, long name 20
2.int; integer, for grades, serial numbers, etc.
3.float; decimal
4.bit, Boolean, for gender, etc.
5. The time also uses varchar, because the datatime obtains the value to need to convert
6.text; A very long number, whatever goes inside.
1. Primary key
Each table must have a primary key, and the primary key is unique. cannot be duplicated in a full table.
2. Self-growth column
Since the growth column is not good Brahma the key when using the name is the IDs type is int this column is meaningless. The following automatic growth point checkmark
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. Type what must be the same, practice time with a type written wrong results can not be established, the future should pay attention to
Rules:
Three main paradigms of database
First paradigm: To guarantee the atomicity of each column, that is, to split the smallest unit
Zibo Zhangdian District, Shandong Province * * * *
Zhangdian District, Zibo, Shandong Province
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
1. Split the table until it cannot be split
2. Table name plus prefix, lowercase
3. If the primary key is not found, use the self-growing column
4. Foreign key relationship can not be added
Database base foreign key or something.