当前位置:网站首页>Let's talk about what DDL, DML, DQL and DCL are in SQL statements
Let's talk about what DDL, DML, DQL and DCL are in SQL statements
2022-08-09 23:43:00 【m0_67393828】
The core language of the database is the SQL language. What are DDL, DML, DQL, and DCL?Let's talk about these four concepts.
I. DDL Statement
DDL (Data Definition Language) statement: Data Definition Language
, mainly to define/change the table structure, data type, link between tables and other operations.Commonly used statement keywords are CREATE, DROP, ALTER, etc.
The template is as follows:
CREATE TABLE table name(column name 1 data type,column name 2 data type,column name 3 data type,...)ALTER TABLE tablename;eg: ALTER TABLE table name ADD column name data type; (add a column)ALTER TABLE table name CHANGE column name new column name new data type; (modify column name)ALTER TABLE table name DROP column name;DROP TABLE table name;DROP DATABASE database name;
Second, DML statement
DML (Data Manipulation Language) statement: Data Manipulation Language
, mainly for adding, deleting and modifying data.Commonly used statement keywords are INSERT, UPDATE, DELETE, etc.
The main differences between DDL statements and DML statements:
DDL
DML
Name
Data Definition Language
Data manipulation language
Difference
Create, delete, modify objects in database
Only operate on the data within the table (does not involve the definition of the table, the modification of the structure, or other objects)
The template is as follows:
INSERT INTO table name (field1,field2,...) values (some value,some value,...),(some value,some value,...);UPDATE tablename SET columnname=new value WHERE qualification;DELETE FROM table name WHERE qualification;
Third, DQL statement
DQL (Data Query Language) statement: Data Query Language
, mainly for querying data.Common keywords are SELECT, FROM, WHERE, etc.
The template is as follows:
SELECT column name FROM table name WHERE qualification;
Fourth, DCL statement
DCL (Data Control Language) statement: Data Control Language
, mainly used to set/change database user permissions.Common keywords are GRANT, REVOKE, etc.
DCL statements are rarely used by ordinary people.
The template is as follows:
GRANT (Grant)REVOKE (revoke permission)
If the article is helpful to you, please click Like, leave a comment to support it?? If you have any questions, you can leave a private message??.If you can give a three-line (Like, Favorite, Follow), it would be best??.
Let me introduce myself first. The editor graduated from Shanghai Jiaotong University in 2013. I worked in a small company and went to big factories such as Huawei and OPPO. I joined Alibaba in 2018, until now.I know that most junior and intermediate java engineers want to upgrade their skills, they often need to explore their own growth or sign up to study, but for training institutions, the tuition fee is nearly 10,000 yuan, which is really stressful.Self-learning that is not systematic is very inefficient and lengthy, and it is easy to hit the ceiling and the technology stops.Therefore, I collected a "full set of learning materials for java development" for everyone. The original intention is also very simple. I hope to help friends who want to learn by themselves but don't know where to start, and at the same time reduce everyone's burden.Add the business card below to get a full set of learning materials
边栏推荐
- 重要的不是成为海贼王,而是像路飞一样去冒险
- 筑牢安全防线 鹤壁经济技术开发区开展安全生产培训
- JS–比想象中简单
- ACM MM 2022 | Cloud2Sketch: 长空云作画,AI笔生花
- Sudoku | Backtrack-7
- [Implementation of the interface for adding, deleting, checking, and modifying a double-linked list]
- MySQL跨表、多表更新SQL语句总结
- BulkInsert方法实现批量导入
- AI+Medical: Using Neural Networks for Medical Image Recognition and Analysis
- 面试官:MySQL 中 update 更新,数据与原数据相同时会执行吗?大部分人答不上来!
猜你喜欢
随机推荐
Technology Sharing | How to Handle Header Cookies in Interface Automation Testing
任务流执行器是如何工作的?
Converting angles to radians
RHEL7系统修复rm -rf /boot /etc/fstab
Install win virtual machine on VMware
同步锁synchronized追本溯源
技术分享 | 接口自动化测试之JSON Schema模式该如何使用?
Simple questions peek into mathematics
How to Make Your Company Content GDPR Compliant
单元测试
小黑leetcode之旅:94. 二叉树的中序遍历(补充Morris 中序遍历)
【双链表增删查改接口的实现】
[Generic Programming] Full Detailed Explanation of Templates
在“企业通讯录”的盲区,融云的边界与分寸
LeetCode26:删除有序数组中的重复项
String hashing (2014 SERC J question)
abstract class or interface
STC8H development (15): GPIO drive Ci24R1 wireless module
TF生成均匀分布的tensor
AI识万物:从0搭建和部署手语识别系统