8.1 What is SQL
SQL English full name is Structured query Language, Chinese meaning is structured query language. It is a language method for defining and manipulating data in a relational database. Is the industry standard supported by most relational database management systems.
8.2 Classification of SQL
The SQL Structured Query language consists of 6 parts.
First, data Query Language (DQL)
DQL Full name Data Query Language, the statement also becomes the database retrieval statement, the function is obtains the data from the table, determines how the data is given in the program. The keyword Select is the most common verb used by 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 with other types of SQL statements, such as:
Mysql> Select User,host from Mysql.user order by Asc\desc;
Ii. Data Manipulation Language (DML)
DML full name Data manipulation Language, whose statements include verb insert,update and delete. They are used to add, modify, and delete rows (data) in a table, respectively. Also known as the action query language. Specific statements such as:
Mysql> Delete from mysql.user where host= ' localhost ';
Query OK, 2 rows affected (0.10 sec)
Iii. Transaction Processing Language (TRL)
Its statement ensures that all rows of the table affected by the DML statement are updated in a timely manner, and the TPL statements include Begin,transaction,commit and rollback. The main understanding of the latter two.
Iv. Data Control Language (DCL)
DCL Full Name (Data Control Language) It acquires a license (authorization and cancellation) in the statement through grant or revoke.
V. Data definition language (DDL)
Full Name (Data Definition Language), whose statements include verb create and drop, create a new table in the database or delete a table (creat table or drop tables), add indexes to the table, and so on.
Six, pointer Control language (CCL)
The full name of the CURSOR Control Language, its statements like declare cursor,fetch into and update WHERE current are used to manipulate one or more tables individually.
Summary: The most common classification of SQL statements is generally 3 categories:
DDL Data Definition Language (CREATE,ALTER,DROOP) operations must be
DML Data Manipulation Language (select,insert,delete,update) development
DCL Data Control Language (grant,revoke,commit,rollback) operation and maintenance must be
Mysql DBA Advanced Operations Learning Note-sql Language introduction and classification