← Back to Keys & ERDs explainer & video  ·  Your teacher will tell you when to use each sheet.

STUDENT · GROUP
CAPE IT · UNIT 2 · MODULE 1 · OBJECTIVES 12 & 13

Mas Camp Database

Island Spirit Mas Band keeps its registrations in a messy notebook. Your group is designing its database: choose the keys, work out the relationships, build the ERD with yarn, and then test it.

Business rules: Island Spirit Mas Band

1. Every masquerader plays in exactly one section (for example Sailor Mas or Midnight Robber). A section has many masqueraders.

2. Masqueraders pay for their costumes in instalments. Each payment is made by one masquerader.

3. The band holds events (fetes, rehearsals, the parade). A masquerader attends many events, and each event has many masqueraders. The band records each check-in time.

4. Each section has exactly one costume design, and each design is for one section.

Sample data: MASQUERADER

MasIDNameEmailPhoneDOBSectionID
M101Kerry-Ann Josephkajoseph@mail.tt868-555-014211 Mar 2007S2
M102Darnell Baptistedbap@mail.tt868-555-019902 Nov 2006S1
M103Kerry-Ann Josephkerryj08@mail.tt868-555-031025 Jun 2008S3
M104Jada Josephjadaj@mail.tt868-555-014219 Aug 2009S2
M105Shivani Ramlalshiv.r@mail.tt868-555-025719 Jan 2007S1
M106Marcus Charlesmcharles@mail.tt868-555-038811 Mar 2007S3

Sample data: ATTENDANCE

MasIDEventIDCheckInTime
M101E119:05
M101E218:40
M102E119:20
M103E218:55
M102E320:10
M104E119:05

All names, emails and phone numbers are fictional.

STUDENT · EACH
WORKSHEET

Name: ____________________________   Group: ______

Task 1 · Key hunt: MASQUERADER

Check the sample data. Could each field be used to identify a masquerader? Give evidence from the data.

FieldUnique in the data? ✓/✗Could it be a candidate key? Why or why not?
MasID
Name
Email
Phone
DOB

Primary key: ______________   Alternate key(s): ______________   Why did you choose that PK? ________________________________

Task 2 · Key hunt: ATTENDANCE

Is MasID unique in ATTENDANCE? ______ Is EventID? ______ What must the primary key be, and what is this kind of key called?

Task 3 · Relationship speed-dating

For each pair, complete both sentences, then decide the relationship type.

“One ____ can have ____ ____.” and “One ____ can have ____ ____.”
Pair1:1, 1:M, M:M or none?Where does the FK go (or what do you need)?
SECTION & MASQUERADER
MASQUERADER & PAYMENT
MASQUERADER & EVENT
SECTION & COSTUME_DESIGN
EVENT & PAYMENT

Task 4 · Yarn ERD

Lay out the entity cards and connect them with yarn. Mark each end: one sticky note with a single bar for “one”, or a sticky note with a crow’s foot for “many”. Resolve any many-to-many with the blank card. Add sticky notes for the attributes, underlining the PKs and marking FKs with *. Then copy your ERD here.

= one= many (crow’s foot)PK underlined · FK marked *
YOUR ERD
STUDENT · EACH
WORKSHEET (CONTINUED)

Task 5 · Your tables in notation

Write every table from your ERD. Underline primary keys and mark foreign keys with *.

Task 6 · Integrity challenge

Your teacher will try to put five changes into your database. For each one, decide: accepted or blocked? If blocked, which rule stops it: primary key, referential integrity or validation?

#Accepted / BlockedRule that decides itExplain
1
2
3
4
5

Task 7 · Exit ticket (no notes) — 6 marks

A driving school records: INSTRUCTOR (InstructorID, Name), LEARNER (LearnerID, Name, Phone, LicenceNo), and VEHICLE (VehicleID, Make, RegNo). Each learner has one instructor, and an instructor has many learners. A learner has lessons in many vehicles, and each vehicle is used by many learners. A lesson happens on a date.

  1. Name two candidate keys for LEARNER. Which would you choose as the primary key? (1)
  2. State the relationship type for INSTRUCTOR–LEARNER and for LEARNER–VEHICLE. (2)
  3. Draw the ERD. Resolve any many-to-many relationship, and show the PKs and FKs. (3)
YOUR ANSWERS
STUDENT · GROUP
ENTITY CARDS · CUT OUT
SECTION
A group within the band, e.g. Sailor Mas
MASQUERADER
A person playing mas with the band
PAYMENT
One instalment towards a costume
EVENT
A fete, rehearsal or the parade
COSTUME_DESIGN
The costume design for a section
 
Blank card: use it if you need a junction table