Worked solution from the Databases Paper 1 Theory Fundamentals booklet, Part 2 of 2.
Definition: write that a data dictionary is data about the data in the database (metadata about its structure). [1]
Example: table names, field names or data types. [1]
Definition: data integrity means the data is consistent and correct, because the database uses methods to keep it that way. [1]
Example: enforcing referential integrity, or validation rules, or cascading update and delete. [1]
A foreign key is a field that is the primary key of another table. Both are in BIRD_SEEN.
| Foreign key | Database table |
|---|---|
| BirdID | BIRD_SEEN |
| PersonID | BIRD_SEEN |
BirdID with BIRD_SEEN [1]
PersonID with BIRD_SEEN [1]
Draw three lines. Each normal form joins to its own definition:
1NF → There are no repeating groups of attributes. 2NF → There are no partial dependencies. 3NF → All fields are fully dependent on the primary key.
All three lines drawn as shown [1]
BirdID has leading zeros (0123), so store it as characters, not integers. Name and Size are text too.
CREATE TABLE BIRD_TYPE(
BirdID CHAR(4) NOT NULL,
Name VARCHAR(9),
Size VARCHAR(6),
PRIMARY KEY (BirdID)
);CREATE TABLE with start and end bracket [1]
BirdID as CHAR or VARCHAR [1]
Name and Size as VARCHAR or CHAR [1]
BirdID as the primary key [1]
Join BIRD_TYPE to BIRD_SEEN, choose the person, then group by size to count each size.
SELECT BIRD_TYPE.Size, COUNT(BIRD_TYPE.BirdID)
AS NumberOfBirds
FROM BIRD_TYPE, BIRD_SEEN
WHERE BIRD_SEEN.PersonID = "J_123"
AND BIRD_TYPE.BirdID = BIRD_SEEN.BirdID
GROUP BY BIRD_TYPE.Size;COUNT [1]
BIRD_SEEN in the FROM line [1]
BIRD_SEEN.PersonID [1]
BIRD_SEEN.BirdID [1]
GROUP BY [1]
▶ Starts at Q2 (19:58)
Starts at Q2 (19:58) · by Pseudocode Pro. Tap the picture to open it on YouTube.
Solutions follow the official Cambridge mark schemes; marks are shown in grey. Videos are from other YouTube channels. Paper codes read component / series / year: M/J = May/June, O/N = October/November. Past-paper questions © UCLES, reproduced for classroom practice.