Mark Yourself Question
A fitness chain records its data in three tables:
HomeClubID is the club where a member signed up. Each check-in at any club creates one VISIT row. The chain has one club in Halifax. The marketing team wants the names of all members who checked in at the Halifax club at least once during September 2026, each member listed once. Different members may share the same name.
a) Identify the primary key and each foreign key in VISIT, and name the table each foreign key refers to.
b) Describe, in order, the join, select and project operations that produce the list. State each join condition and the selection conditions.
c) A member who checked in at Halifax eight times in September could appear eight times in the result. Explain why, and how to list each member once.
d) Describe one specific error that enforcing the foreign key on VISIT.ClubID prevents.
Unlock full course notes by signing up
Keys in an enrolment linking table
A college stores its records in three tables:
STUDENT(StudentID, Name, Program)
COURSE(CourseCode, Title, Credits)
Applying two membership filters
A recreation centre tests two alternative filters on its membership table. Apply each rule independently to every member, and enter keep or omit in each answer cell.
Rule P keeps a row when Age is at least 18 AND Fee paid is Yes.
Rule Q keeps a row when Age is at least 18 OR Fee paid is Yes. Here, OR includes rows that satisfy both conditions.
Predicting the result of an inner join
A distributor stores its sales representatives and their sales in two tables.
SALESREP
SALE
Following successive inventory changes
A stationery shop performs two operations on the inventory table below. Each operation completes before the next begins, and no other changes occur.
UPDATE: Increase Units by 3 for every row whose Category is Pen AND whose Status is Active.
DELETE: Remove every row whose Status is Clearance OR whose Units value is 0.