MySQL Basic Learning_Lesson 005_Relationship About the Concept of Tables

1. The definition of the table

A table is the basic unit of a database and is a structured file that can be used to store specific types of data. All data are organized in tabular form, purpose: strong readability. For example: student information and course information can all be put into the table. In addition, the tables have specific names and cannot be repeated.

2. Table common terms

There are several common conceptual terms in a table: column, row, primary key, foreign key, composite key, redundancy

Row: Also called tuple or record, it is a group of related data;

Column: also called a field, contains the same type of data;

Primary key: The primary key is unique, and a data table can only contain one primary key, and you can use the primary key to query data;

Foreign key: foreign key is used to associate two tables;

Composite key: also called composite key, using multiple columns as an index key, generally used for composite index;

Redundancy: Store twice the data. Redundancy reduces performance, but improves data security;

3. The attributes of the column (field)

Each column (field) should include:

     Field name

     type of data

     Relevant constraints (such as certain fields cannot be empty)

 

Guess you like

Origin blog.csdn.net/weixin_43184774/article/details/115070803