Results 1 to 2 of 2
  1. #1
    Join Date
    May 2006

    database design questions

    I'm designing a website for a local Sub Shop and I need some help with the database layout.
    There are ten categories of food: Subs, Footlongs, Sandwiches, Platters, Soups, Chineese Food, Eggrolls, Side Orders, Drink and Extras.
    Each item in each category has a price, but some has more than one, for example:
    Cheese Steak Sub: 6" price and 12" price.
    Shrimp Fried Rice: Pint price and Quart price.
    Drinks: Small Price, Medium Price, Large Price.
    While Platters, Sandiches, Soups and some others have only one size/price.

    How should I handle this? Throw everything into one table with a bunch of columns? I could use an example if that's not asking for too much.


  2. #2
    Join Date
    Apr 2002
    Toronto, Canada
    make each item unique

    i.e. 6" sub is not the same item as 12" sub

    give these items separate primary keys

    you can have a separate categories table, if you wish, and place a foreign key into the items table that references the category the item belongs to | @rudydotca
    Buy my SitePoint book: Simply SQL

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts