Easier to read with cream paper, a tint, more contrast or larger text? Choose your colours and text, once, for every page.

Preview

AC 2.8: One-to-one, one-to-many and many-to-many

This is the first page of the lesson. Read it and have a go at the activities. The rest is in the full lesson.

60 minutes

How many clubs can one pupil join?

One form has many pupils. One pupil has one locker. A pupil can join many clubs, and a club has many pupils.

These three sentences are three different kinds of link. Each kind is stored in its own way.

Key words

WordWhat it means
Relationshipa link between two entities
Cardinalityhow many records on one side link to records on the other side
One-to-oneone record links to exactly one record, written 1:1
One-to-manyone record links to many records, written 1:M
Many-to-manymany records link to many records, written M:M
Link tablean extra table that turns a many-to-many link into two one-to-many links
Crow's footthe three-pronged mark at the end of a line that means many
Primary keythe field that gives every record its own unique id
Foreign keya field that holds the primary key of a record in another table
Databasean organised store of tables that you can ask questions
SQLthe language used to ask a database for data

The cells students fill in are left blank in this preview.

By the end of this lesson

Note

I can name the three kinds of relationship, show them with crow's foot lines, and say how each is stored.

Starter

Have a go

Starter

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The three kinds of relationship

KindExampleDrawn asStored by
One-to-one (1:1)A pupil and a lockerA plain lineA foreign key, unique, on either table
One-to-many (1:M)A form and its pupilsA crow's foot at the many endA foreign key on the many side
Many-to-many (M:M)Pupils and clubsA crow's foot at both endsA link table with a composite key

The cells students fill in are left blank in this preview.

Read the lines

Have a go

Read the lines

3 questions
Have a go: your answers are marked here and then forgotten. Sign in if you would like your score kept, and to pick up where you left off.Sign in to keep your score

Your answers are marked here and are not kept. A college account keeps every student’s marks.

The lesson goes on

10 more parts of this lesson are in the full curriculum, with the tasks, the final check and the labs. A college account gives your students all of it.