CustomerID |
Name |
Address |
City |
1 |
Single |
Bai Lu |
Changsha |
2 |
Single |
Footmarks |
Hangzhou |
3 |
Wang |
Ehuang |
Beijing |
MySQL is a relational database, the relational database is also called a table, observe the above table, you can find:
① columns: Columns have unique names, such as customerid,city, they all contain different data, and all have a related data type, CustomerID for integer data, and name,city for character data.
② Line: Each row represents each customer, each row has the same format, and one row is called a record.
③ value: Each row is made up of a single value for each column, which must be the same as the data type of the column in which it is located.
④ key: How to identify each customer, that is, each row. It is generally not recommended to use a name, for example, a name column may have more than one person with the same name. Then you need to assign each customer a unique value, such as CustomerID in the table above, which is called a key or primary key, and the primary key may contain more than one column.
MySQL Database design