#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    14
    Rep Power
    0

    Database design help


    Hi there,

    I am a 3rd year student and got a course work project where I have to build a dummy e commerce website for a Event company which organises events. The website should offer users to buy event, accommodation and car parking tickets for their different music festival events.

    I am having great difficulty in designing a Normalized database design and would really appreciate if someone could point me in the right direction. Please note the database needs to have relationships between the tables.

    Thanks.
    Ryan
  2. #2
  3. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,280
    Rep Power
    4279
    Originally Posted by ryanfern86goa
    Please note the database needs to have relationships between the tables.
    it's really easy

    one table has a primary key, and another has a foreign key which references the first table's primary key, and this forms the relationship
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2013
    Posts
    14
    Rep Power
    0
    Hi r937,

    Thanks for your reply.

    The requirements require me to create a separate table for events, accommodation, car parking. The reason for this is because for each event there might be different type of accommodation available and car parking tickets might be available only for certain types hence I can't get around of to connect order items table with these 3 tables namely events, accommodation, car parking.

    Thanks again
  6. #4
  7. SQL Consultant
    Devshed Supreme Being (6500+ posts)

    Join Date
    Feb 2003
    Location
    Toronto Canada
    Posts
    27,280
    Rep Power
    4279
    Originally Posted by ryanfern86goa
    ...I can't get around of to connect order items table with these 3 tables namely events, accommodation, car parking.
    someone buying a ticket (or tickets, if they have to buy them separately) is going to result in creating a new row in a table which i think you want to call order items, and this row will have references to the event, accomodation, and/or car parking... using foreign keys

    the only thing you have to decide is whether a single ticket can cover one, two, or three of these things
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

IMN logo majestic logo threadwatch logo seochat tools logo