Results 1 to 1 of 1
  1. #1
    Join Date
    Sep 2015
    Posts
    1

    Food ordering database design .

    I wanted to make sure the design for a particular part is correct or not.
    The scenario is : A pizza can be customized by its size,toppings,crust etc.But the prize of toppings will depend on the size ;like when size 7" is selected the prize for each topping will be $1 and for size 14" the prize will be $2 (or some other customization can be dependent on some other one).One of the customization can be available only for a particular size;like when size 7" is selected then only another customization will be displayed.
    (This scenario is just an example and there are many more things other than pizza which will have customization as it is a food ordering app )

    Currently for this problem ive designed 3 tables.
    1)Dishes(d_id,name,desc,base_price)
    2)Customization(c_id,d_id(foreign key,name)
    3)options(o_id,c_id(foreign key),parent_id,name,price)

    the customization table will hold the name of customization like size,crust,toppings etc.
    And the options table will hold the contents of each customization.
    The parent_id in options will refer the same table in order to satisfy the condition of previously selected options.

    eg:1) dishes
    id name
    1 pizza
    2) customization
    c_id d_id name
    1 1 size
    2 1 toppings
    3) options
    o_id c_id parent_id name price
    1 1 1 7" 5$
    2 1 2 14" 10$
    3 2 1 abc 1$
    4 2 2 abc 2$
    Is there any better way of representing this in the db.
    Please guys revert back as soon as possible and please suggest any other changes or functionality I should include in the design(other than this part too).
    It will be great if any helpful links are provided.

    Thank you.
    Last edited by Parikshith; 09-13-15 at 13:03.

Tags for this Thread

Posting Permissions

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