什么是DDL和DML? [英] What are DDL and DML?

查看:247
本文介绍了什么是DDL和DML?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我听说过有关数据库的DDL和DML术语,但我不明白它们是什么。

I have heard the terms DDL and DML in reference to databases, but I don't understand what they are.

它们是什么,它们与SQL有什么关系?

What are they and how do they relate to SQL?

推荐答案

更多信息,请参见: MySQL什么是DDL,DML和DCL?,原始内容如下:

More information see here: MySQL What is DDL, DML and DCL?, the original is as follows:


DDL

DDL是数据定义语言的简称,它处理
数据库模式和说明,说明数据应如何存放在
数据库中。

DDL is short name of Data Definition Language, which deals with database schemas and descriptions, of how the data should reside in the database.


  • 创建–创建数据库并它的对象(表,索引,视图,存储过程,函数和触发器)

  • ALTER –更改现有数据库的结构

  • DROP –从数据库中删除对象

  • 截断–从表中删除所有记录,包括为记录分配的所有空间都被删除

  • 注释–向数据字典添加注释

  • 重命名–重命名对象

  • CREATE – to create database and its objects like (table, index, views, store procedure, function and triggers)
  • ALTER – alters the structure of the existing 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

DML是数据处理语言的简称,它处理数据
的操作,包括最常见的SQL语句,例如SELECT,
INSERT,UPDATE,DELETE等,它用于存储,修改,检索,
删除和更新数据库中的数据。

DML is short name of Data Manipulation Language which deals with data manipulation, and includes most common SQL statements such SELECT, INSERT, UPDATE, DELETE etc, and it is used to store, modify, retrieve, delete and update data in database.


  • SELECT –从数据库中检索数据

  • INSERT –将数据插入表中

  • UPDATE –更新表中的现有数据

  • DELETE –删除数据库表中的所有记录

  • MERGE – UPSERT操作(插入或更新)

  • CALL –调用PL / SQL或Java子程序

  • EXPLAIN PLAN –数据访问路径的解释

  • 锁定表–并发控制

  • SELECT – retrieve data from the a database
  • INSERT – insert data into a table
  • UPDATE – updates existing data within a table
  • DELETE – Delete all records from a database table
  • MERGE – UPSERT operation (insert or update)
  • CALL – call a PL/SQL or Java subprogram
  • EXPLAIN PLAN – interpretation of the data access path
  • LOCK TABLE – concurrency Control

DCL

DCL是数据控制语言的简称,它包含命令
(例如GRANT),并且主要涉及数据库系统的权限,权限和其他
控件。

DCL is short name of Data Control Language which includes commands such as GRANT, and mostly concerned with rights, permissions and other controls of the database system.


  • GRANT –允许用户访问数据库权限

  • REVOKE –撤消用户使用GRANT命令赋予的访问权限

TCL

TCL是简称事务控制语言,用于处理数据库中的
事务。

TCL is short name of Transaction Control Language which deals with transaction within a database.


  • COMMIT –提交事务

  • ROLLBACK –在发生任何错误的情况下回滚事务

  • SAVEPOINT –在组内回滚事务点

  • SET TRANSACTION –指定交易的特征

  • COMMIT – commits a Transaction
  • ROLLBACK – rollback a transaction in case of any error occurs
  • SAVEPOINT – to rollback the transaction making points within groups
  • SET TRANSACTION – specify characteristics for the transaction

这篇关于什么是DDL和DML?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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