1-n relationship, same PK connected to more than one field? GUI shows "1-n" for first connection... nothing for the next

I’m stuck. (And yes, I’m new :neutral_face: ) I need an “AHA!” moment to keep going.

Any help, much appreciated!

Imagine this:

A database for Clubs at a school.

The main CLUBS Table has fields such as: “Club-ID”, “Club name”, etc.
It also contains fields for “Student_president”, “Student_Vice-pres”, “Student_secretary”.

There is a separate STUDENTS table, with a “Student-ID” and fields for name, birth date, etc.

How can I build a relationship between the “Students” table & the three fields that require student information? When I try to use the GUI to link “Student-ID” (PK) to “Student-President” (FK), as a 1-n relationship, it works: “1” and “n” appear as expected in the GUI, next to the line that links the PK and FK in the tables.

But if I then try to link the “Student-ID” (PK) to “Student_Vice-pres” or “Student_Secretary”, I get a message: "This relationship already exists. Do you want to edit it or create a new one?"

If I choose “create”, a line will appear - but there is no “1” or “n” next to the fields, as expected.

Why…? Am I doing something wrong, or is there something wrong in the design?

Thank you - for your patience. I’m sure this is simple, and I’m just not seeing it! :blush:

EDITED to add: Screenshot. (Ignore the actual Table and Field names. I used the “Club” example above because it was easy to understand, but my actual data is about something else.)

2nd EDIT to add: LibreOffice Base v.7.2.7.2, + Windows 10.

You will need a table for “assignment” with “ID” and “assignment”. ‘president’, vice-president’ and ‘secretary’ are all “assignment”.
Then there must be a table with assignmentID and studentID. So you get a n:m-correlation.

You couldn’t connect one primary key to more than one field.

1 Like

Hi, thanks for your reply! I’m a bit of a “newbie”, so I tried to follow what you said. Not sure if I achieved it… or did something else… (?)

This is what I did:

I created a ROLE table, with “Role-ID” (Key) and “Role” fields (and 3 records, “President”, “Vice-President” and “Secretary”)

I created an “ASSIGNMENTS” table, with four fields: “Assignment-ID” (Key), “Club-ID”, “Student-ID” and “Role-ID”.

Then I created relationships involving the “ASSIGNMENTS” table: the Club-ID (CLUB table), the “Student-ID” (STUDENT table), the “Role-ID” (ROLE table) were all linked…It looks like this, now:

I think / hope this will work! Thanks for the help!

Looks good for me.