This article brings you relevant knowledge aboutmysql, which mainly introduces issues related to the data model and SQL language, that is, how data is stored in MySQL, and the SQL Let’s take a look at some preliminary understanding of statements. I hope it will be helpful to everyone.
Recommended learning:mysql video tutorial
We know that MySQL is a relationship Relational database management system (RDBMS), and relational database (RDB) is the most widely used database today.
Relational databases, like Excel worksheets, use two-dimensional tables composed of rows and columns to store data. And relational databases use specialized SQL language to manipulate data.
Example: The following is the data of a "Student Table"
MySQL is a client/server (C/S) system, which can realize database read and write operations by sending SQL statements from the client to the server.
A MySQL server can have multiple databases, and each database can also have multiple tables. After the client connects to one of the databases, it can operate the tables in the database.
SQL is a language developed to operate relational databases. Although SQL also has standards, in fact SQL is different depending on the RDBMS.
The International Organization for Standardization (ISO) has developed corresponding standards for SQL, and the SQL based on this is called standard SQL.
However, each RDBMS does not fully comply with this standard, which will result in SQL that can be used on Oracle but cannot be used on MySQL, and vice versa. Of course, each RDBMS's support for standard SQL is getting better and better. As long as you learn standard SQL, you can basically write SQL statements in various RDBMS.
SQL statement is a statement composed of keywords, table names, column names, etc. Keywords are words whose meaning or usage has been defined. For example: the query keyword is
create
; which table it comes from, usefrom
, etc.
According to the different types of instructions given to RDBMS, SQL statements can be divided into three categories:
There will be an article later that will introduce these three SQL statements in detail, so I won’t go into details here.
You must abide by some grammar rules when writing SQL statements.
The writing method of constants is fixed: string or date type constants are enclosed in single quotes; numeric types can be written directly.
Recommended learning:mysql video tutorial
The above is the detailed content of Detailed explanation of MySQL basics: data model and SQL language. For more information, please follow other related articles on the PHP Chinese website!