本文翻译自:What is DDL and DML? [closed]
Want to improve this question? 想改善这个问题吗? Update the question so it focuses on one problem only by editing this post . 更新问题,使其仅通过编辑此帖子来关注一个问题。
Closed 11 months ago . 11个月前关闭。
I have heard the terms DDL and DML in reference to databases, but I don't understand what they are. 我听说过有关数据库的DDL和DML术语,但我不明白它们是什么。
What are they and how do they relate to SQL? 它们是什么,它们与SQL有何关系?
#1楼
参考:https://stackoom.com/question/Aohm/什么是DDL和DML-关闭
#2楼
DML is abbreviation of Data Manipulation Language . DML是数据操纵语言的缩写。 It is used to retrieve, store, modify, delete, insert and update data in database. 它用于检索,存储,修改,删除,插入和更新数据库中的数据。
Examples: SELECT, UPDATE, INSERT statements 示例:SELECT,UPDATE,INSERT语句
DDL is abbreviation of Data Definition Language . DDL是数据定义语言的缩写。 It is used to create and modify the structure of database objects in database. 它用于创建和修改数据库中数据库对象的结构。
Examples: CREATE, ALTER, DROP statements 示例:CREATE,ALTER,DROP语句
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/ 请访问此网站以获取更多信息: http : //blog.sqlauthority.com/2008/01/15/sql-server-what-is-dml-ddl-dcl-and-tcl-introduction-and-examples/
#3楼
DDL is Data Definition Language : it is used to define data structures . DDL是数据定义语言 :用于定义数据结构 。
For example, with SQL, it would be instructions such as create table
, alter table
, ... 例如,对于SQL,它将是诸如create table
, alter table
,...等指令。
DML is Data Manipulation Language : it is used to manipulate data itself . DML是数据操纵语言 :它用于操纵数据本身 。
For example, with SQL, it would be instructions such as insert
, update
, delete
, ... 例如,对于SQL,它将是诸如insert
, update
, delete
,...等指令。
#4楼
DDL = Data Definition Language, any commands that provides structure and other information about your data DDL =数据定义语言,任何提供有关数据的结构和其他信息的命令
DML = Data Manipulation Language, there's only 3 of them, INSERT, UPDATE, DELETE. DML =数据处理语言,只有3种,即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
) 4,如果您SELECT * INTO x_tbl from tbl
MSSQL的SELECT * INTO x_tbl from tbl
计算SELECT * INTO x_tbl from tbl
(ANSI SQL: CREATE TABLE x_tbl AS SELECT * FROM tbl
)
#5楼
In simple words. 简单来说。
DDL(Data definition language): will work on structure of data. DDL(数据定义语言):将用于数据结构。 define the data structures. 定义数据结构。
DML (data manipulation language): will work on data. DML(数据操作语言):将对数据起作用。 manipulates the data itself 操纵数据本身
#6楼
DDL is Data Definition Language: Just think you are defining the DB. DDL是数据定义语言:只是认为您正在定义数据库。 So we use CREATE,ALTER TRUNCATE commands. 因此,我们使用CREATE,ALTER TRUNCATE命令。
DML is after defining we are Manipulating the data. DML是在定义我们正在处理数据之后。 So we use SELECT,INSERT, UPDATE, DELETE command. 因此,我们使用SELECT,INSERT,UPDATE,DELETE命令。
Remember DDL commands are auto-committed. 请记住,DDL命令是自动提交的。 You don't need to use COMMIT statements. 您不需要使用COMMIT语句。
DML (Data Manipulation Language) commands need to be commited/rolled back. DML(数据操作语言)命令需要提交/回滚。