Get the App
SLTechnology News&Howtos  ›  Database  › 

What does DML, DDL, DCL in MySQL mean?

Shulou Source: shulou.com Published: 2022-06-01 01:54:13 09月21日 Update

Editor to share with you what the meaning of DML, DDL, DCL in MySQL, I believe that most people do not understand, so share this article for your reference, I hope you will learn a lot after reading this article, let's go to understand it!

Introduction

For a long time, many people can't tell what these three things are, what they represent, and may get the wrong person when they meet in the interview. Today, let's share these three small knowledge points with you.

In fact, these three concepts should be no stranger to the little friends who walk CURD every day. They can be said to be used every day.

DML (data manipulation language) data manipulation language

DML: that is, we often use select, update, insert, delete to perform some operations on the data in the database, that is, the addition, deletion, modification and query of the data is called = = DML==.

Example is the following SQL code:

SELECT field name | * FROM table name; UPDATE table name SET field name = 'new value' WHERE field name = 'some value'; INSERT INTO table_name (column 1, column 2.) VALUES (value 1, value 2...); DELETE FROM table name WHERE column name = 'some value'

DDL (data definition language) data definition language

DDL: these are some of the SQL statements we used to create tables. For example: CREATE, ALTER, DROP, etc. DDL is mainly used to define tables or to change the physical structure, data types, links between tables and physical constraints and other initialization operations.

Example is the following SQL code:

#-create table create table table name (column name 1, data type, column name 2, data type,...) engine=innodb default charset=utf8mb4 collate=utf8mb4_general_ci#engine=innodb setting table engine # default charset=utf8mb4 setting table encoding character set # collate=utf8mb4_general_ci setting character order #-modify table alter table table name drop field name; alter table table name add field name data type [field constraint] [field constraint] #-- wait a sentence like this.

DCL (Data Control Language) data control language

DCL: statements used to set or change database user role permissions, such as grant, revoke statements

Create user 'test_r'@'%' IDENTIFIED BY' test_rpwd';GRANT SELECT ON `test_ db`. * TO 'test_r'@'%' IDENTIFIED BY' test_rpwd'; is all the contents of this article entitled "what is the meaning of DML, DDL and DCL in MySQL?" Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Data name field type statement three articles language meaning code content characters that is database physics knowledge strangers wrong objects not much things Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno MySQL Shulou Tech Info Apple Shulou Technology vpn