Skip to content

9618 · 8.3

Data Definition Language (DDL) and Data Manipulation Language (DML) — FAQ

Frequently asked questions for 9618 Data Definition Language (DDL) and Data Manipulation Language (DML). Direct answers first, then deeper explanation — then practise with marking.

Can I use DDL and DML commands in the same script?

Yes, absolutely. It's very common to have a script that first uses DDL to create or alter tables, and then uses DML to populate those tables with initial data.

Is SQL the only language with DDL and DML?

While SQL is the most common and standardized language for relational databases, the concepts of DDL and DML are fundamental to most database management systems, even if the specific syntax differs.

What's the difference between `DELETE FROM Tutor;` and `DROP TABLE Tutor;`?

DELETE FROM Tutor; is a DML command that removes all rows from the Tutor table, but the table structure itself (columns, constraints) remains. You can still insert new data into it. DROP TABLE Tutor; is a DDL command that permanently deletes the entire table, including its structure and all data. The table no longer exists.

Why are data types part of DDL?

Data types (like INT, VARCHAR, DATE) are part of the table's definition or 'blueprint'. They define the kind of data that a column is allowed to hold, which is a structural rule. Therefore, specifying them is a DDL operation, typically within a CREATE TABLE or ALTER TABLE statement.