Take the 2-minute tour ×

I am trying to discover the best way to design my database to organize information related to events.

I have an events table which contains all the information about the event such as, a unique id, title of the event, venue etc.

Now each event can have multiple ticket types and the number and type of tickets will change with each event.

Is it better to have a events_tickets table which has a seperate row for each ticket type e.g.

event_id    ticket_type    price
1           standard       20
1           deluxe         40
1           cheap          10

Or is it better to have the table formatted so that the information is on one row?

event_id    ticket_information
1           standard:20,deluxe:40,cheap:10

If I use the first way I could end up with 10 rows per event which when multiplied by lots of events could become very large, whereas the second version could have problems with data integrity.

share|improve this question

3 Answers 3

up vote 10 down vote accepted

the first one... definitely. :) having as much of your data as separate as possible is ALWAYS the best way... it makes it much more usable and much easier to change/upgrade/expand the code later.

In fact I would have 3 tables: events, event_options and ticket_types

event_options would just be literally a link table between the events and the ticket_types, and can include other information you need to hold per event. This way it will make it easier still to a) search by ticket type and b) add more ticket types because when you come to add a new ticket type to an existing event (or something similar) you will have a lot more issues the second way.

share|improve this answer
+1 for the right advice –  ovais.tariq Aug 24 '10 at 10:41
I don't know whether having a third table would be worth while in this case. Presumably, a "standard" ticket for one event might be a different price to a standard ticket for another event, and then it's dubious to what extent they can truly be said to be "the same ticket type" (in anything but name). –  Hammerite Aug 24 '10 at 10:44
Thanks for the great advice, I will definitely go with the first way. Just to be clear in my mind for every case, is there no real performance impact on having a table with potentially thousands and thousands more rows that the "parent" object its referring too (in this case the "parent" object would be the event) or would it only matter when we are talking about seriously big sites like Facebook etc. –  Kevin Aug 24 '10 at 10:48
It would only matter for seriously big sites. –  Hammerite Aug 24 '10 at 10:50
I wouldn't even think that seriously big sites like facebook will have a problem with mysql before they have a problem with bandwidth or server speed. –  Thomas Clayson Aug 24 '10 at 10:51

The official answer is to do it the first way. If you only ever have exactly the same three types of tickets, then you can get on with having three "ticket price" fields. But otherwise, relational-purism tells you to go with the first.

I'm assuming that in any event you have an "events" table. Tell you what: search for "third normal form" on your favorite search engine, and you'll learn a lot about designing databases.

share|improve this answer
Thanks for your answer, I will go with the first way. –  Kevin Aug 24 '10 at 10:50

The first way is better. It is more normalised. Why does this matter? It means it's much easier to query your data. You don't want to use the second way, because it'll be really complicated and time-consuming to retrieve data at a later time.

share|improve this answer

Your Answer


