When working with Structured Query Language (SQL), Data Definition Language (DDL) and Data Manipulation Language (DML) are two subcategories of SQL that have two distinct purposes.
DDL is used to change the structure of the database. It’s a set of commands used to create, modify, delete data structure but not data (Lithmee, 2017). Think of it as setting the rules for defining how your data is going to be stored. For example, a database designer can use DDL to create database objects (tables, indexes, views etc.) and define the access rights to those objects (Coronel, Morris, & Rob, 2010). Here are some examples of DDL commands:
DML is used to manage the data in the database. It’s a set of commands used to add, remove, modify or retrieve data (Lithmee, 2017). Think of it as once we have defined how data is stored (DDL), DML is how we interact with the data. For example, a database user can use DML to insert, delete, update, and retrieve data inside of a database (Coronel, Morris, & Rob, 2010).
The easy way to remember the difference between the two is that if it affects your scheme and the database structure it is DDL. If modifies your content (the rows) then it is DML.
Lithmee. (2017, December 30). Difference between DDL and DML. Retrieved from https://www.differencebetween.com/difference-between-ddl-and-vs-dml/
Coronel, C., Morris, S., & Rob, P. (2010). Database systems: design, implementation, and management. (9th ed.). Boston: Cengage Learning, Inc.