locked
SQL database table design for my online food delivery application using .net mvc5 RRS feed

  • Question

  • User-471420332 posted

    I need SQL database table design for my online food delivery application

    I have 10 resturent vender, and i have to sell food online through my application of my different 10 vender foods. Every vendor have some different type of food in there menus

    But i refer below url getting confuse

    https://stackoverflow.com/questions/32366294/database-design-for-food-ordering-system-mysql

    Actually i am using sql r2 database and according to my knowlege there will be following tables

    Customer
    Order
    Vender

    Monday, December 31, 2018 12:43 PM

All replies

  • User753101303 posted

    Hi

    You should likely have a vendor foreign key in most if not all tables so that each vendor will only ever see its own rows (such as foods and drinks). Maybe you'll have a menu table so that you can handle which kind of food is part of which menu etc... In short it all depends on what you want to do. So make sure to first be 100% sure of what you want. A first cause about wondering about a table design is when you don't still really know anyway how you want to manage things from a non technical point of view.

    Or if it doesn't help try to be more explicit about the point that you find confusing ?

    Monday, December 31, 2018 1:54 PM
  • User475983607 posted

    Seems to me an online food delivery application would have a lot more than 3 tables.  IMHO, the lack of tables and no requirements indicates little time spent thinking about application features and general design.  Have you spoke to Vendors? Customers?  Anyone that has an interest in this application being successful?

    Monday, December 31, 2018 2:11 PM
  • User-471420332 posted

    please can you give example which I can easy understand..
    Monday, December 31, 2018 2:16 PM
  • User-471420332 posted
    Can you share main table structure which I can easily understand
    Monday, December 31, 2018 2:18 PM
  • User475983607 posted

    Can you share main table structure which I can easily understand

    You have to realize that's impossible given the title requirement "SQL database table design for my online food delivery application using .net mvc5".  To user's login?  Do user pay online?  How is the menu updated?  How are orders submitted?  These are just a few of many clarifying questions.

    Secondly, You're asking the community to design and build your application.  Taking this post and your others into consideration, I suspect that you have spent little to no time coming up with requirements or a basic design flow.  At least you have not expressed this here.   Your best bet is paying someone to help build the online food delivery application using .net mvc5.  

    Monday, December 31, 2018 2:36 PM
  • User-471420332 posted
    if I will not study then above I have posted example url.. I have study little confusing between order and menus table structure leave if you think like that.. also I am working on flow chart..
    Monday, December 31, 2018 5:11 PM
  • User475983607 posted

    if I will not study then above I have posted example url.. I have study little confusing between order and menus table structure leave if you think like that.. also I am working on flow chart..

    The concept is the classic Customers, Orders, and OrderDetail found in many Getting Started with relational DBs tutorials.  See the AdventureWork DB for an example.

    https://docs.microsoft.com/en-us/sql/samples/adventureworks-install-configure?view=sql-server-2017

    Your design is a little different as there are many Vendors.  As PatriceSc explained, you'll have a VendorId in most tables.  This allows you to partition the Vendor specific records.

    Monday, December 31, 2018 5:33 PM
  • User-271186128 posted

    Hi Sir,

    In my opinion, the Food table should like this: it should contain the type and vender foreign key.

    Foods:
     	Food_id (PK)
    	Food_name
    	Food_size
    	Food_price (Describe price of each food)
    	Type_id [FK]  (type of the food)
    	Vender_id [FK] (the vender)
    

    Then, you could based on the Vender_id to query the food table and check each vendor's food.

    Best regards,
    Dillion

    Tuesday, January 1, 2019 2:30 AM
  • User379720387 posted

    That example structure is sending you in the wrong direction.

    First of all the structure is incomplete, all other posters have alluded to this.

    Second you would not want to have separate order tables for food and drinks.

    Look at an order as a combination of items (food, drinks, snacks, internet access, etc) with a price, to a specific customer.

    The Order table is the specific customer, time, date, payment method, and some progress indicator.

     The OrderedItems table (the association table) tells you what items were ordered and what the price was.

    It looks something like this: Id, itemId, orderId, quantity, itemPrice

    The Item table has all things that are for sale, with a price and an item type:

    itemId, description, itemTypeId, measure, weight, volume, count, price

    The ItemType table looks like this:

    itemTypeId, ItemType

    Translating a business process into a data structure is something you need to do yourself because only you know what the requirements are, or can find out.

    Sunday, January 6, 2019 5:27 PM