9618 · 8.3
Data Definition Language (DDL) and Data Manipulation Language (DML) flashcards
Revision flashcards for Cambridge 9618 Data Definition Language (DDL) and Data Manipulation Language (DML) (syllabus 8.3). Flip, recall, then mark a real past-paper question.
Card
What is Data Definition Language (DDL)?
A subset of SQL used to define and manage the database structure or schema. Its commands affect the tables themselves, not the data inside them.
Card
What is Data Manipulation Language (DML)?
A subset of SQL used to retrieve, insert, update, and delete data within the database tables.
Card
Which SQL command creates a new table?
CREATE TABLE. This is a DDL command.
Card
Which SQL command modifies the structure of an existing table?
ALTER TABLE. This DDL command can add, delete, or modify columns.
Card
Which SQL command completely removes a table and all its data?
DROP TABLE. This is a DDL command and is irreversible.
Card
Which SQL command retrieves data from a database?
SELECT. This is the primary DML command for querying data.
Card
Which SQL command adds a new row of data to a table?
INSERT INTO. This is a DML command.
Card
Which SQL command modifies existing data in a table?
UPDATE. This DML command must be used with a WHERE clause to specify which rows to change.
Card
Which SQL command removes one or more rows from a table?
DELETE FROM. This DML command should almost always be used with a WHERE clause to avoid deleting all rows.
Card
What is the difference between DELETE and DROP?
DELETE is a DML command that removes rows of data from a table. DROP is a DDL command that removes the entire table structure and all its data.
Card
What is a PRIMARY KEY constraint?
A DDL constraint that uniquely identifies each record in a table. It cannot contain NULL values and must be unique.
Card
What is a FOREIGN KEY constraint?
A DDL constraint used to link two tables together. It is a field in one table that refers to the PRIMARY KEY in another table, enforcing referential integrity.
Card
What is the purpose of the NOT NULL constraint?
A DDL constraint that ensures a column cannot have a NULL (empty) value. It forces a field to always contain a value.