Each question is a database from a Cambridge International AS & A Level Computer Science (9618) Paper 1: its tables, its fields, and often some of its data. Design it: give every field a data type, mark the fields that make up each table's primary key, and say which fields are foreign keys, and which table each refers to. The SQL that creates your design is written as you go (the SQL toggle shows it).
- Data types are the ones the syllabus uses: INTEGER (whole numbers), REAL (numbers with a decimal part), CHARACTER, shown here as CHAR(n), or VARCHAR(n) (text, of up to n characters: the length is optional), BOOLEAN (TRUE or FALSE), DATE and TIME. The mark schemes also accept CURRENCY for money.
- Clues are in the data: a value with letters, or a leading zero (
002323), is text; a value with a decimal part is REAL; a phone number is text, because it isn't calculated with.
- A primary key identifies each row. Mark two fields for a composite key.
- A foreign key holds another table's primary key, and must have the same data type.
Checking. Check your design once every field has a type. Each field that's wrong says why, and you can change it and check again. Once it's all right, or you show the model answer, you see the model SQL and an E-R diagram of the database. Where a question's mark scheme gives the SQL for a table, that's the model; elsewhere the types follow the data and the question, and where nothing shows what an ID looks like, INTEGER and text are both right.
Signed in, your designs are saved: come back to any question and carry on where you left off. Done questions are ticked in the list, and Random question picks one you haven't done yet.
Set by your teacher. Questions your teacher has set you are marked in the list, and come up first. Each field is worth a mark if it's right (its type and keys) the first time you check. If you had already done one before it was set, it starts again, fresh; after that you can have as many attempts as you like, and your best counts.
Objective: write an SQL script to define a table (CREATE TABLE) with appropriate data types, a primary key and foreign keys (9618 syllabus 8.3, Data Definition Language).
Where this fits
- AQA: AQA A Level Computer Science (7517)
- Cambridge: Cambridge IGCSE Information and Communication Technology (0417); Cambridge A Level Computer Science (9618); Cambridge AS Level Computer Science (9618); Cambridge A Level Information Technology (9626); Cambridge AS Level Information Technology (9626) Goes beyond Cambridge IGCSE Information and Communication Technology (0417): 0417 builds tables in database software; writing CREATE TABLE in SQL goes beyond it.
Goes beyond Cambridge A Level Information Technology (9626): 9626 builds tables in database software; writing CREATE TABLE in SQL goes beyond it.
Goes beyond Cambridge AS Level Information Technology (9626): 9626 builds tables in database software; writing CREATE TABLE in SQL goes beyond it.
- IB: IB Computer Science HL; IB Computer Science SL
- NCEA Level 2 Digital Technologies: 91891 Apply conventions to develop a design for a digital technologies outcome; 91891 Apply conventions to develop a design for a digital technologies outcome; 91892 Use advanced techniques to develop a database; 91892 Use advanced techniques to develop a database
- NCEA Level 3 Digital Technologies: 91902 Use complex techniques to develop a database; 91902 Use complex techniques to develop a database
- Pearson Edexcel International: Edexcel International GCSE ICT (4IT1); Edexcel International A Level Information Technology Goes beyond Edexcel International GCSE ICT (4IT1): 4IT1 builds tables in database software; writing CREATE TABLE in SQL goes beyond it.