MySQL Forums
Forum List  »  Newbie

Stop multiple attendance at same event by person
Posted by: Simon Finch
Date: February 23, 2020 04:48AM

I'm logging attendance at events. I have the following fields;

event_register_id (PrimaryKey)
event_id
person_id

event_id links to another table with the list of events.
person_id links to another table with the list of people.

I'm trying to set up the table so that an event can only be appear once in the table (by using a unique index) as it only happens once on a given date. A person can attend many events but NOT the same event twice.

I'm struggling with how to set this up. I tried a joint unique index with event_id and person_id in the index but that wouldn't allow me to add a person more than once to the table.

Where am I going wrong please?

Options: ReplyQuote


Subject
Written By
Posted
Stop multiple attendance at same event by person
February 23, 2020 04:48AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.