DDL vs DML: How SQL Commands Are Split Between Structure and Data

SQL is divided into two core command types: Data Definition Language (DDL) and Data Manipulation Language (DML). DDL commands such as CREATE, DROP, and ALTER define or modify the structure of a database — its tables, columns, and data types — without affecting stored data. DML commands like INSERT, UPDATE, DELETE, and SELECT operate on the actual data within those structures. A key distinction is that DDL changes are largely irreversible once committed, whereas DML operations can often be rolled back using transactions. This makes upfront planning of database structure critical, since altering it later with ALTER becomes riskier when real data and dependent queries are already in place.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.

Discussion (0)
Log in to join the discussion and vote.
Log in