02, first know SQL

02, first know SQL

table of Contents

02, first know SQL

1. What is SQL?

    2.SQL general syntax

    3. SQL classification


1. What is SQL?


    Structured Query Language: The structured query language
    actually defines the rules for operating all relational databases. Each way of database operation is different, which is called "dialect".


    
2.SQL general syntax


    1. The SQL statement can be written in a single line or multiple lines, ending with a semicolon.
    2. Spaces and indentation can be used to enhance the readability of sentences.
    3. The SQL statements of the MySQL database are not case-sensitive. It is recommended to use uppercase for keywords.
    4. 3 kinds of comments
        * Single line comment: - Comment content or # comment content (mysql unique) 
        * Multi-line comment: /* Comment*/


    
3. SQL classification


    1) DDL (Data Definition Language) data definition language is
        used to define database objects: databases, tables, columns, etc. Keywords: create, drop, alter, etc.
    2) DML (Data Manipulation Language) data manipulation language is
        used to add, delete, and modify the data in the database table. Keywords: insert, delete, update, etc.
    3) DQL (the Data Query Language) data query language
        used to query records (data) tables in the database. Keywords: select, where, etc.
    4) DCL (Data Control Language) data control language (understand) is
        used to define database access rights and security levels, and create users. Keywords: GRANT, REVOKE, etc.

Guess you like

Origin blog.csdn.net/qq_43629083/article/details/109005270