Planning a three-table query for a marketing list

Mark Yourself Question

  1. Grab a piece of paper and try this problem yourself.
  2. When you're done, check the "I have answered this question" box below.
  3. View the solution and report whether you got it right or wrong.

A fitness chain records its data in three tables:

  • MEMBER(MemberID, Name, HomeClubID, JoinDate)
  • CLUB(ClubID, City)
  • VISIT(VisitID, MemberID, ClubID, VisitDate)

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.

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Relational Database Operations Questions: