0

I'm developing small application for a company. What they want me to do is some kind of event website which they can add participants for each event. My question is should I have one table for all the participants for all events or should I create a table for each event and store participants inside it ?

Sorry about my English if there are any grammar errors.

CristiC
  • 22,068
  • 12
  • 57
  • 89

4 Answers4

5

You should have 3 tables:

One with participants (participant_id, name, address...)

One with events (event_id, date, place...)

and one with participants to the events (id, participant_id, event_id)

CristiC
  • 22,068
  • 12
  • 57
  • 89
1

Personally, I would use three tables. The first stores the list of events, the second stores the list of participants, and the third contains the relationship between events and participants (stores event_id and participant_id combinations).

That allows you to keep a list of participant details that's separate from any given event, so they can be invited to/added as participants of future events from a pre-populated list, rather than requiring the same details to be added repeatedly.

Anthony Grist
  • 38,173
  • 8
  • 62
  • 76
0

Tables for events, participants and their relations. Read about data normalization.

Nick Pavluk
  • 379
  • 2
  • 7
0

The following tables should help you map the requirement:

Events - to hold all the Event specific Information Users - to hold all the Users in the website (remember, a user can participate in more than 1 event) Participants - this holds the relationship (many to many) for the users who participate in the Events

So sample columns:

  • Events - event_name, event_description, event_date
  • Users - first_name, last_name, email
  • Participants - event_id(fk : Events.id), user_id(fk: Users.id)
sprezzatura
  • 472
  • 5
  • 17