Spotting the DDL statement
Which of these SQL statements is part of the Data Definition Language (DDL)?
A INSERT INTO
B ALTER TABLE
C UPDATE
D SELECT
[1]
- 1
Ask of each option: does it change the structure, or the data? INSERT INTO adds records, UPDATE changes values and SELECT queries data. All three work on the data, so they are DML.
- 2
ALTER TABLE changes the structure of a table (for example adding a field), so it is DDL. Answer B (1).
Answer
B
Examiner tip
Examiner tip: DDL statements in the syllabus are CREATE DATABASE, CREATE TABLE and ALTER TABLE (with PRIMARY KEY and FOREIGN KEY). Everything else you write on Paper 1 is DML.
Common mistake: choosing UPDATE because it 'changes the table'. It changes the values in records, not the table's definition.