ExamYard Lectures

Normalisation, E-R diagrams and SQL scripts

A Level Computer Science 9618 · Chapter 8, Databases · 7-minute lecture

The teaching part (1 min) is free to watch. A free account opens the whole lecture: 1 worked example, 5 practice questions, 2 real past-paper questions with the answers explained, the mistakes that lose marks, the full-marks tip, a one-card summary and a quick quiz.

What this lecture covers

  1. Design it once, query it forever
  2. First normal form
  3. Second and third normal form
Read the transcript of the teaching part

Last time

Before we start: last time, in Relational databases, you learned these points. Here they are again on one card. Keep them in mind, because today builds on them.

Design it once, query it forever

A badly designed database repeats data, so every update is a risk. Normalisation is the cleaning process that splits tables until every fact is stored in one place. And once the tables are right, SQL is the language you use to create them, fill them, and ask questions of them.

First normal form

A table is in first normal form if every field holds a single value, and there are no repeating groups of fields. A field called Items holding hammer, nails, saw breaks the rule. Each item needs its own row. Each table also needs a primary key.

Second and third normal form

Second normal form: in 1NF, and every non-key field depends on the whole of the primary key. It matters when the key has two fields. Third normal form: in 2NF, and no non-key field depends on another non-key field. A simple memory aid: every field depends on the key, the whole key, and nothing but the key.

Chapter 8: Databases

Also for A Level Computer Science 9618

Which topics come up most in A Level Computer Science 9618 past papers, counted from every paper since 2004: Paper 1 topic frequency, Paper 2 topic frequency.