如何查找SQL查询类型是DML还是DDL? [英] How to find whether the SQL query type is DML or DDL?

查看:853
本文介绍了如何查找SQL查询类型是DML还是DDL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何查找SQL查询类型是否为DDL或DML?

How can you find whether the SQL query type is DDL or DML?

推荐答案

数据定义语言用于定义数据库结构或模式。一些示例:
CREATE - 在数据库中创建对象
ALTER - 更改数据库的结构
DROP - 从数据库中删除对象
TRUNCATE - 从表中删除所有记录,包括为记录分配的所有空间
COMMENT - 向数据字典添加注释
RENAME - 重命名对象

Data Definition Language (DDL) statements are used to define the database structure or schema. Some examples: CREATE - to create objects in the database ALTER - alters the structure of the database DROP - delete objects from the database TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed COMMENT - add comments to the data dictionary RENAME - rename an object

数据操作语言DML)语句用于管理模式对象中的数据。一些示例:
SELECT - 从数据库检索数据
INSERT - 将数据插入表
UPDATE - 更新表中的现有数据
DELETE - 从表中删除所有记录,记录的空间保留
MERGE - UPSERT操作(插入或更新)
CALL - 调用PL / SQL或Java子程序
EXPLAIN PLAN - 解释数据的访问路径
LOCK TABLE - 控制并发

Data Manipulation Language (DML) statements are used for managing data within schema objects. Some examples: SELECT - retrieve data from the a database INSERT - insert data into a table UPDATE - updates existing data within a table DELETE - deletes all records from a table, the space for the records remain MERGE - UPSERT operation (insert or update) CALL - call a PL/SQL or Java subprogram EXPLAIN PLAN - explain access path to data LOCK TABLE - control concurrency

这篇关于如何查找SQL查询类型是DML还是DDL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆