Mysql tutorial (1): Mysql data model and SQL syntax analysis

Mysql tutorial (1): Mysql data model and SQL syntax analysis

1. Mysql data model

1.1 Relational database (RDBMS)

Concept: A database based on a relational model and composed of multiple interconnected two-dimensional tables.

Features:

  • Use stored data in a unified format for easy maintenance
  • Use SQLlanguage operation, unified standards, easy to use

1.2 Data model

[External link image transfer failed. The source site may have an anti-leeching mechanism. It is recommended to save the image and upload it directly (img-HMWLBeVf-1689585450571) (C:\Users\Administrator\AppData\Roaming\Typora\typora-user-images\ image-20230717170636361.png)]

2. SQL syntax analysis

2.1 SQL general syntax

  1. SQL statements can be written on a single line or on multiple lines and end with a semicolon.
  2. SQL statements can be used to 空格/缩进enhance the readability of statements.
  3. The SQL statements of the MYSQL database are not case-sensitive, and it is recommended to use uppercase letters for keywords.
  4. Note:
    1. Single line comment: --注释内容or# 注释内容(Mysql特有)
    2. Multi-line comments:/*注释内容*/

2.2 SQL classification

Classification full name illustrate
DDL Data Definition Language data definition language, used to定义数据库对象(数据库、表、字段)
DML Data Manipulation Language Database operating language, used to对数据库表中的数据进行增删改
DQL Data Query Language data query language, used to查询数据库中表的记录
DCL Data Control Language data control language, used to创建数据库用户、控制数据库的访问权限

Guess you like

Origin blog.csdn.net/WwLK123/article/details/131770988