Skip to content

9618 · 8.3

Data Definition Language (DDL) and Data Manipulation Language (DML) — common mistakes

Common exam mistakes on 9618 Data Definition Language (DDL) and Data Manipulation Language (DML). Learn what loses marks, then practise the topic with Examiner’s Ink.

Exam tip 1

A very common mistake is forgetting the WHERE clause on an UPDATE or DELETE statement. Without a WHERE clause, UPDATE will change every single row in the table, and DELETE will remove every single row. In an exam, always include a WHERE clause with these commands unless you are explicitly asked to affect all records.

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.