什么是 DDL 和 DML?
我听说过有关数据库的术语 DDL 和 DML,但我不明白它们是什么。
它们是什么以及它们与 SQL 有何关系?
I have heard the terms DDL and DML in reference to databases, but I don't understand what they are.
What are they and how do they relate to SQL?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(13)
以下内容改编自这里MySQL 什么是 DDL、DML 和 DCL?:
The following is adapted from here MySQL What is DDL, DML and DCL?:
DDL 是数据定义语言:它用于定义数据结构。
例如,对于 SQL,它将是诸如
create table
、alter table
等指令,...DML 是数据操作语言:它用于操作数据本身。
例如,对于 SQL,它将是诸如
insert
、update
、delete
等指令。DDL is Data Definition Language : it is used to define data structures.
For example, with SQL, it would be instructions such as
create table
,alter table
, ...DML is Data Manipulation Language : it is used to manipulate data itself.
For example, with SQL, it would be instructions such as
insert
,update
,delete
, ...DDL是数据定义语言:用于定义数据的规范符号
数据库架构。
它适用于架构级别。
DDL 命令为:
create、drop、alter、rename
例如:
DML 是数据操作语言。它用于访问和操作数据。
DML 命令有:
例如:
DDL is Data Definition Language : Specification notation for defining the
database schema.
It works on Schema level.
DDL commands are:
create,drop,alter,rename
For example:
DML is Data Manipulation Language .It is used for accessing and manipulating the data.
DML commands are:
For example :
DDL,数据定义语言
例如:
CREATE
、ALTER
、DROP
、TRUNCATE
、COMMIT
等DML、数据操作语言
DML语句对表有影响。这就是我们在表中执行的基本操作。
SELECT
、INSERT
、UPDATE
等执行。DML中使用以下命令:
INSERT
>、更新
、选择
、删除
等。DDL, Data Definition Language
e.g.:
CREATE
,ALTER
,DROP
,TRUNCATE
,COMMIT
, etc.DML, Data Manipulation Language
DML statement are affect on table. So that is the basic operations we perform in a table.
SELECT
,INSERT
,UPDATE
, etc.Below Commands are used in DML:
INSERT
,UPDATE
,SELECT
,DELETE
, etc.通俗地说,假设你想盖一座房子,你会做什么。
DDL
即数据定义语言,即
CREATE
更改
删除和删除CREATE
TRUNCATE
DML
即数据操作语言人们进出你的房子
SELECT< /code>
DELETE
UPDATE
DCL
即数据控制语言你想控制人们在房子的哪一部分允许访问和访问类型。
授予权限
In layman terms suppose you want to build a house, what do you do.
DDL
i.e Data Definition Languagethat is
CREATE
ALTER
DROP & CREATE
TRUNCATE
DML
i.e. Data Manipulation LanguagePeople come/go inside/from your house
SELECT
DELETE
UPDATE
DCL
i.e. Data Control LanguageYou want to control the people what part of the house they are allowed to access and kind of access.
GRANT PERMISSION
请访问此站点以获取更多信息:http://blog.sqlauthority.com/2008/01/15/sql-server-what-is-dml-ddl-dcl-and-tcl -简介和示例/
Visit this site for more info: http://blog.sqlauthority.com/2008/01/15/sql-server-what-is-dml-ddl-dcl-and-tcl-introduction-and-examples/
DDL = 数据定义语言,提供有关数据的结构和其他信息的任何命令
DML = 数据操作语言,只有3种,INSERT、UPDATE、DELETE。 4、如果你会算MSSQL的
SELECT * INTO x_tbl from tbl
(ANSI SQL:CREATE TABLE x_tbl AS SELECT * FROM tbl
)DDL = Data Definition Language, any commands that provides structure and other information about your data
DML = Data Manipulation Language, there's only 3 of them, INSERT, UPDATE, DELETE. 4, if you will count
SELECT * INTO x_tbl from tbl
of MSSQL (ANSI SQL:CREATE TABLE x_tbl AS SELECT * FROM tbl
)DDL 是数据定义语言:假设您正在定义数据库。
所以我们使用 CREATE、ALTER TRUNCATE 命令。
DML 是在定义之后我们正在操作数据。所以我们使用 SELECT、INSERT、UPDATE、DELETE 命令。
请记住,DDL 命令是自动提交的。您不需要使用 COMMIT 语句。
DML(数据操作语言)命令需要提交/回滚。
DDL is Data Definition Language: Just think you are defining the DB.
So we use CREATE,ALTER TRUNCATE commands.
DML is after defining we are Manipulating the data. So we use SELECT,INSERT, UPDATE, DELETE command.
Remember DDL commands are auto-committed. You don't need to use COMMIT statements.
DML (Data Manipulation Language) commands need to be commited/rolled back.
DDL代表数据定义语言。 DDL 用于定义表的结构,例如创建表或向表添加列,甚至删除和截断表。
DML 代表数据操作语言。顾名思义,DML 用于操作表的数据。 DML中有一些命令,例如插入和删除。
DDL stands for Data Definition Language. DDL is used for defining structure of the table such as create a table or adding a column to table and even drop and truncate table.
DML stands for Data Manipulation Language. As the name suggest DML used for manipulating the data of table. There are some commands in DML such as insert and delete.
DDL
创建、更改、删除(数据库、表、键、索引、视图、函数、存储过程)
DML
插入、删除、更新、截断(表)
DDL
Create,Alter,Drop of (Databases,Tables,Keys,Index,Views,Functions,Stored Procedures)
DML
Insert ,Delete,Update,Truncate of (Tables)
简单来说。
DDL(数据定义语言):将处理数据结构。定义数据结构。
DML(数据操作语言):将处理数据。操纵数据本身
In simple words.
DDL(Data definition language): will work on structure of data. define the data structures.
DML (data manipulation language): will work on data. manipulates the data itself
DDL:更改架构
DML:更改数据
似乎特定于 MySQL 限制(rails 的源代码)
DDL: Change the schema
DML: Change the data
Seems specific to MySQL limitations (rails's source code)
对 DML 的不同回应可能会对调查 dbt 的人有所帮助,dbt 是一种广泛使用的用于部署数据的开源工具转变。 (在此处查看更多详细信息。)
dbt 有助于“select”语句,但不能其他 DML 命令。请参阅,例如 “为什么我不能在转换中编写 DML?”
A different response on DML may be helpful for those investigating dbt, a widely used open source tool for deployment of data transformations. (See More detail here.)
dbt facilitates "select" statements but not other DML commands. See, e.g. "Why can't I just write DML in my transformations?"