Show that the Database Management System (DBMS) carries out all creation and modification of the database structure using its Data Definition Language (DDL).
| Statement | Purpose |
|---|---|
CREATE | Creates a new database object (e.g., CREATE TABLE, CREATE INDEX, CREATE SCHEMA). |
ALTER | Modifies the definition of an existing object (add/drop columns, change constraints, rename). |
DROP | Removes an object permanently. |
TRUNCATE | Deletes all rows from a table while keeping its definition. |
GRANT / REVOKE | Defines or removes user privileges on database objects (security‑related DDL). |
Note: DDL statements are implicitly committed by the DBMS; in most systems they cannot be rolled back with ROLLBACK.
| Statement | Purpose |
|---|---|
SELECT | Retrieves data from one or more tables. Read‑only – it does not change the data dictionary. |
INSERT | Adds new rows to a table. |
UPDATE | Modifies existing rows. |
DELETE | Removes rows from a table. |
CREATE TABLE or GRANT privilege).ROLLBACK.The data dictionary (or system catalog) holds a description of every database object. When a DDL command runs:
DROP TABLE erases the table’s metadata).Subsequent DML statements are validated against this metadata – an INSERT will be rejected if it tries to store a value in a non‑existent column or violates a declared constraint.
GRANT and REVOKE are subject to privilege checks; only authorised users can create, alter, drop, or change access to objects.BEGIN TRANSACTION;
INSERT INTO …
UPDATE …
COMMIT; -- or ROLLBACK;
CHAR(n) (fixed length), VARCHAR(n) (variable length).INTEGER, DECIMAL(p,s), NUMERIC(p,s).DATE, TIME, TIMESTAMP.PRIMARY KEY (col1, …)UNIQUE (col)FOREIGN KEY (col) REFERENCES other_table(col)CHECK (condition)NOT NULLCREATE TABLE Statement<create‑table‑stmt> ::= CREATE TABLE <table‑name> '(' <column‑def> { ',' <column‑def> } [ ',' <table‑constraint> ] ')' ';'
<column‑def> ::= <column‑name> <data‑type> [ <column‑constraint> ]
<data‑type> ::= CHAR '(' <int> ')' |
VARCHAR '(' <int> ')' |
INTEGER |
DECIMAL '(' <int> ',' <int> ')' |
DATE
<column‑constraint> ::= NOT NULL |
UNIQUE |
PRIMARY KEY |
CHECK '(' <condition> ')'
<table‑constraint> ::= PRIMARY KEY '(' <column‑list> ')' |
FOREIGN KEY '(' <column‑list> ')' REFERENCES <table‑name> '(' <column‑list> ')' |
CHECK '(' <condition> ')'
-- 1️⃣ DDL: create a schema (optional)
CREATE SCHEMA University AUTHORIZATION dbo;
-- 2️⃣ DDL: create a table for student records
CREATE TABLE University.Student (
StudentID INTEGER PRIMARY KEY,
Name VARCHAR(50) NOT NULL,
DOB DATE,
GPA DECIMAL(3,2),
Email VARCHAR(100) UNIQUE,
CONSTRAINT chk_GPA CHECK (GPA BETWEEN 0.00 AND 4.00)
);
-- 3️⃣ DML: insert a new student
INSERT INTO University.Student (StudentID, Name, DOB, GPA, Email)
VALUES (101, 'Alice Smith', '2002-04-15', 3.85, 'alice.smith@example.com');
-- 4️⃣ DDL: add a column for the date of enrolment
ALTER TABLE University.Student
ADD EnrolDate DATE NOT NULL DEFAULT CURRENT_DATE;
-- 5️⃣ DML: update the newly added column for the existing row
UPDATE University.Student
SET EnrolDate = '2020-09-01'
WHERE StudentID = 101;
-- 6️⃣ DML: retrieve the student record
SELECT * FROM University.Student WHERE StudentID = 101;

COMMIT / ROLLBACK statements.Your generous donation helps us continue providing free Cambridge IGCSE & A-Level resources, past papers, syllabus notes, revision questions, and high-quality online tutoring to students across Kenya.