Six original Cambridge-style questions on SQL DDL, with model statements and mark points.
Explain the difference between a data definition language (DDL) and a data manipulation language (DML).
A cinema stores films in a table FILM. Write an SQL statement to create the table with these fields: FilmID (a code such as F0123, primary key), Title (up to 50 characters), Rating (one character, such as U), Duration (whole number of minutes), Released (date) and InColour (true or false).
A table SCREENING(ScreeningID, FilmID, ScreenNo, StartTime) has already been created with ScreeningID as its primary key. Write SQL statements to (a) make FilmID a foreign key linked to FILM and (b) add a field Price that stores a real number.
State a suitable SQL data type for (a) a telephone number, (b) the time a lesson starts, (c) whether a fee has been paid.
A student writes:
CREATE TABLE Pupil(
PupilID INTEGER
Name VARCHAR(30),
FormID VARCHAR(3),
PRIMARY KEY (Name)
);Identify three problems with this statement.
Write the SQL statement to create a new database called Cinema.
Mark this once you have attempted all six and checked your working. It records a Practiced badge on the topic and adds a one-time bonus. Revealing the solutions alone does not count.