This article mainly introduces the mysql relational database to everyone. I hope it will be helpful to friends in need!
Recommended reference tutorial: "mysql tutorial"
Relational database,is a database built on a relational model (mathematical model).
As for the relational model, it is a so-called model based on relationships, which includes three aspects, namely:
Data structure: data Storage form, two-dimensional table (rows and columns);
Operation instruction set: all SQL statements;
Integrity constraints: Data constraints within tables (fields and fields) and constraints between tables (foreign keys).
Database: Analyze the data requirements that need to be stored. If it is a type of data (entity), it should be designed as Two-dimensional table;
Two-dimensional table: consists of header (field name, used to specify the name of the data) and data (actually stored content).
Two-dimensional table example:
EEROR_CODE | DESCRIPTION | |
---|---|---|
US0001 | This user is not registered | |
OR0001 | Order generation failed | |
SY0001 | Unknown system exception |
3 Keyword Description
, essentially refers to a row (a record) in the table. A row is from a structural perspective, and a record is from a structural perspective. From a data perspective.
, essentially refers to a column (a field) in the table, the column is from the structural point of view, and the field is from From a data perspective.
SQL is mainly divided into three types:
,drop
andalter
etc.
,delete
andupdate
, etc., but there is a separate classification within DML, namely DQL (Data Query Language), data query language, the representative command isselect
.
andrevoke
, etc.
The above is the detailed content of MySQL tutorial relational database. For more information, please follow other related articles on the PHP Chinese website!