October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run ScanOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk3 min

Building vs Running: A Simple Way to Understand DDL and DML

DDL builds and changes database structures; DML works with the rows inside them. A plain-language guide with examples, a comparison table, and the SELECT classification caveat.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

SQL statements fall into two broad jobs. Some build or reshape the containers that hold data, and others work with the data inside those containers. Keeping that split in mind makes most SQL commands easier to read, and it explains why a single mistake in one group can do far more damage than a mistake in the other.

The short answer

DDL (Data Definition Language) is the part of SQL that defines or changes database structures such as tables. DML (Data Manipulation Language) is the part that works with the rows stored in those structures. In the building-and-running picture, DDL is the construction crew that lays out rooms and walls, and DML is the daily activity of putting things in those rooms, finding them, and moving them around.

As an Amazon Associate I earn from qualifying purchases.

Building: what DDL does

Microsoft Learn describes DDL statements as those that define data structures, and the core commands are CREATE, ALTER, and DROP (Microsoft Learn, Transact-SQL statements, updated 21 September 2026). Oracle’s reference uses the same idea, describing DDL in terms of operations on schema objects (Oracle Database 18c SQL Language Reference, Types of SQL Statements).

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • CREATE makes a new object, such as a table, with a chosen set of columns.
  • ALTER changes an existing object’s shape, for example by adding or modifying a column.
  • DROP removes the object entirely, along with the data it holds.

Running: what DML does

DML works with data stored in database objects. The common statements are INSERT, UPDATE, and DELETE. Microsoft SQL Server also lists SELECT and MERGE as DML statements (Microsoft Learn, Queries).

  • INSERT adds new rows.
  • UPDATE changes values in rows that already exist.
  • DELETE removes rows while leaving the table itself in place.
  • SELECT reads rows without changing them.
  • MERGE combines insert, update, and delete logic into one statement based on a match condition.

A worked example

The sequence below shows both jobs in order. The syntax is illustrative. Exact details, such as data type names and the handling of quotes, can differ between database products.

  1. Build the table: CREATE TABLE customers (id INT, name VARCHAR(100)); This is DDL. Nothing is stored yet except the definition.
  2. Add a row: INSERT INTO customers (id, name) VALUES (1, 'Ada'); This is DML.
  3. Change a value: UPDATE customers SET name = 'Ada Lovelace' WHERE id = 1; This is DML, and the table’s columns are unchanged.
  4. Read it back: SELECT id, name FROM customers; This is DML in SQL Server’s classification.

Notice that steps 2 through 4 never alter the table’s shape. Only step 1 does.

Comparing the two groups

Question DDL DML
What does it act on? Structure of database objects, such as tables Data stored in those objects
Typical operations Create, alter, drop Insert, update, delete, and (in SQL Server) select and merge
Representative command CREATE TABLE INSERT
Effect on existing rows Can remove them along with the object, or change how they are stored, depending on the statement Changes only the rows the statement targets

Where the classification gets blurry

Product documentation does not agree on every label. Microsoft SQL Server lists SELECT as DML. Oracle’s reference describes SELECT as a limited form of DML because it accesses data, which is a different framing from calling it simply a data-manipulation statement (Oracle Database 18c SQL Language Reference). Both descriptions are consistent with the core idea that DML is about data rather than structure. When you read a book or a vendor manual, check which convention it uses. Most readers will run into this question when they see SELECT in a list of “data” commands.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why the distinction matters in practice

Because DDL changes structure, its effects reach beyond a single row. Microsoft’s Access documentation warns that data-definition queries can inadvertently change table design or lose data, and it recommends backing up the tables involved before you run one (Microsoft Support, Data-definition queries in Access). That advice is specific to Access. It is a good habit anywhere, but the exact recovery options depend on the database system you use.

A practical rule follows from the split. Before running a DDL statement, confirm which object it targets and whether a backup exists. Before running a DML statement that changes rows, confirm the WHERE condition, because an UPDATE or DELETE without one applies to every row in the table.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

A quick way to remember it

Ask what the statement is touching. If the answer is the table’s columns, indexes, or existence, it is DDL. If the answer is the rows, it is DML. Statements that only read rows, such as SELECT, sit in the DML group in most references, with the Oracle caveat above.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Crashes, No Sound, or Screen Glitches?Free driver scan
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.