First, MySQL overview
MySQL is a relational database, not perfect compared to other databases, but flexible enough to adapt to a variety of environments, such as the lamp architecture and the LNMP architecture of Web applications. Colleagues can also be embedded in applications and support a variety of application types such as database warehouses, content indexing and non-speaking software, highly available redundancy systems, and online transaction processing systems (OLTP).
MySQL is the most unique of his data storage engine architecture, the design of this architecture in query processing and other system tasks and data storage/extraction phase separation. This separation of processing and storage design allows you to choose how data is stored based on performance, characteristics, and other requirements when used.
1.1 shows the logical architecture diagram of MySQL.
650) this.width=650; "class=" Size-medium wp-image-39 aligncenter "src=" http://120.79.1.118/wordpress/wp-content/ Uploads/2017/11/mysql%e7%9a%84%e5%ad%98%e5%82%a8%e6%9e%b6%e6%9e%84-300x196.png "width=" "height=" 196 "style=" border:0px;vertical-align:middle;height:auto;margin:5px auto; "/>
The logical structure from top to bottom is the connector, the core service layer of MySQL and the storage engine layer;
First Layer: Connector link client, provide application interface, etc.
Second layer: MySQL's core functional layer MySQL management, query parsing, analysis, optimization, caching and all of the built-in functions, all of the functions that require cross-storage engines are implemented at that level: stored procedures, triggers, and views.
Tier Three: the storage engine Tier storage engine is responsible for storing and extracting data from MySQL. Each storage engine has its advantages and disadvantages. The server communicates with the storage engine through the API. These interfaces mask the differences between different storage engines, making these differences transparent to the upper-level query process. The Storage Engine API contains dozens of underlying functions for performing operations such as injection transactions. However, the storage engine does not parse SQL, and the storage engine does not communicate with each other, but simply requests from the corresponding upper-level servers.
Second, understand SQL:
Structured Query Language (structured query Language) is a special purpose programming language, a database query and programming language for accessing data and querying, updating, and managing relational database systems, as well as the extension of database script files.
SQL language Structure
The Structured Query language consists of 6 parts:
One: Data query Language (dql:data query Language):
Its statement, also known as a "data retrieval statement," is used to obtain data from a table to determine how the data is given in the application. Reserved word select is the most used verb for dql (and all SQL), and the other dql commonly used reserved words are where,order by,group by and having. These dql reserved words are often used in conjunction with other types of SQL statements.
Two: Data manipulation language (Dml:data manipulation Language):
Its statements include verb insert,update and delete. They are used to add, modify, and delete rows in a table, respectively. Also known as the action query language.
Three: Transaction processing language (TPL):
Its statement ensures that all rows of the table affected by the DML statement are updated in a timely manner. The TPL statement includes begin TRANSACTION,COMMIT and rollback.
Four: Data Control Language (DCL):
Its statements are licensed through grant or revoke to determine access to database objects for individual users and groups of users. Some RDBMS can use grant or revoke to control access to individual columns of a table.
Five: Data definition language (DDL):
Its statements include verb create and drop. Create a new table or delete a table (creat table or drop tables) in the database, add an index to the table, and so on. The DDL includes many reserved words related to the data obtained in the Human database directory. It is also part of the action query.
Six: Pointer control Language (CCL):
Its statements, like declare cursor,fetch into and update WHERE current, are used to operate on separate rows for one or more tables.
This article is from "Little Chong" blog, please make sure to keep this source http://maoxiaoxiong.blog.51cto.com/11705634/1981577
1, MySQL database basic introduction