Quick wins for a faster PC:
Scan for outdated or missing drivers - takes under a minuteDriver Scan →Repair Windows errors before they cause bigger problemsFix Now →DDL defines the structure of a database, DML changes the data stored in it, and SELECT retrieves data for a query. The label DQL (Data Query Language) is often used for querying, but SQL references do not all classify SELECT the same way. The examples below use PostgreSQL-style SQL.
What is the difference between DDL and DML in SQL?
SQL works with relational data organized into tables. A table has columns that describe the kinds of information it holds and rows that contain individual records. The simplest distinction is about what a statement acts on:
As an Amazon Associate I earn from qualifying purchases.
- DDL (Data Definition Language) defines or changes database structures, such as tables and their columns.
- DML (Data Manipulation Language) adds, changes, or removes rows within those structures.
- Querying retrieves and shapes results from stored data. Many beginner explanations call this DQL.
Think of DDL as defining the container, DML as changing its contents, and a query as reading selected information from it. These labels help organize SQL concepts, but the classification boundary is not universal.
How to create a table and add a row
Consider a small table of students. In PostgreSQL-style SQL, CREATE TABLE defines the table and its columns; it does not add a student record.
#1 Best Overall
CREATE TABLE students (
student_id integer,
name text,
cohort integer
);
This is DDL: it establishes a structure with an integer student ID, a text name, and an integer cohort. To add a row to that existing table, use INSERT:
INSERT INTO students (student_id, name, cohort)
VALUES (1, 'Mina', 2026);
INSERT is DML because it changes the stored row data rather than defining the table.
What does DQL mean, and what does SELECT do?
DQL stands for Data Query Language. It is a useful beginner label for statements that retrieve data, especially SELECT. For example:
Recommended Free Tools
SELECT name, cohort
FROM students;
This asks for the name and cohort values from the students table. SELECT retrieves query results; it does not change the stored rows. Some SQL classifications group SELECT with data statements rather than treating DQL as a separate category. PostgreSQL’s tutorial presents querying separately from updates and deletions, while its command reference includes SELECT among PostgreSQL commands. See the PostgreSQL SQL Commands reference for the system’s command list.
How do UPDATE and DELETE change table data?
To change an existing row, use UPDATE. To remove a row, use DELETE. Both are DML:
UPDATE students
SET cohort = 2027
WHERE student_id = 1;
DELETE FROM students
WHERE student_id = 1;
In the example, the update changes Mina’s cohort value, and the delete removes the row with student ID 1. These examples show the basic purpose of each command; consult the documentation for the database system you use when syntax or behavior matters.
Rank #4
What should you learn next?
A practical learning sequence moves from defining a table to working with the information in it. PostgreSQL 18’s tutorial follows this general progression:
- Learn how tables and columns represent relational data.
- Create a table with
CREATE TABLE. - Populate it with rows using
INSERT. - Retrieve data with
SELECT. - Combine related tables with joins.
- Summarize data with aggregate functions.
- Change and remove rows with
UPDATEandDELETE.
The PostgreSQL 18 SQL tutorial covers these topics and says it assumes general computer knowledge, but no particular Unix or programming experience. It is an introduction to PostgreSQL, relational database concepts, and SQL—not a guarantee that every database system supports identical syntax or behavior. PostgreSQL’s command reference documents commands supported by PostgreSQL and points to command-specific compatibility details.
Quick Recap
Best Value
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.




