Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1092819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T23:44:21+00:00 2026-05-16T23:44:21+00:00

Restaurants have buffets. and Buffets have different spreads. i wanna enable photo and comments

  • 0

Restaurants have buffets. and Buffets have different spreads. i wanna enable photo and comments on each dish on the Buffet. not sure which is the best way to store them in Database

What i have done ?

I have a Restaurant Db that stores the general information of the REst.
Dishes DB that stores Dishes of the Resturants. each dish is again mapped to a category like Starters, Drinks, Main Course.

Now how to store the Dishes as a part of a Buffet of a Restaurant in a normalized way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T23:44:21+00:00Added an answer on May 16, 2026 at 11:44 pm

    You need a Restaurant table with a unique primary key REST_ID and other Restaurant attributes (like name and location, name of chef)

    You need a Buffet table with the primary key (REST_ID, BUFFET_ID), and other Buffet attributes such as name ( “Salad Bar,” “Smorgasbord,” or “Sweets” for example.)

    You need a Dish table with the primary key (REST_ID, BUFFET_ID, DISH_ID) and other attributes such as name (“Potato Salad,” “Buttered Nan”)

    You need a Photos table with the primary key (REST_ID, BUFFET_ID, DISH_ID, PHOTO_ID) and other attributes, for example a pathname or blob for the photo itself, and a caption.

    You need a Reviews table with the primary key (REST_ID, BUFFET_ID, DISH_ID, REVIEW_ID).

    Notice that there’s a design choice in this data model: it is not possible for the same dish to appear on two different buffets. Nor is it possible for the same buffet to appear in two different restaurants. That is, the data is strictly hierarchical:

    One restaurant: zero, one, or more buffets
    One buffet: zero, one or more dishes
    One dish: zero, one or more photos
    One dish: zero, one or more reviews
    

    This makes sense for a review application. If you get food poisoning from the egg salad in Restaurant A, it makes no sense for your negative review of the dish to appear under Restaurant B.

    Here are some example rows for each table.

    Restaurant (REST_ID, Name, Chef)

    1 "McDonalds" Ronald
    2 "Julia's Place" Julia
    3 "Ritz Carlton Dining Room" Jack
    

    Buffet (REST_ID, BUFFET_ID, Name)

    2 1 "Soup Bar"   (this is the soup bar at Julia's place)
    2 2 "Salad Bar"  (the salad bar at Julia's place)
    3 1 "Cold Breakfast"  (the cold breakfast bar at the hotel dining room)
    3 2 "Sweets"  ( the dessert bar at the hotel dining room)
    

    Dish: (REST_ID, BUFFET_ID, DISH_ID, name and category)

    2 1 1 "Minestrone" "Soup"
    2 1 2 "French Onion" "Soup"
    2 1 3 "Vegetarian Barley" "Soup"
    2 1 4 "Saltines" "Crackers"
    3 1 1 "Melon" "Fruit"
    3 1 2 "Strawberry" "Fruit"
    3 1 3 "Blueberry Muffin" "Bread"
    3 1 4 "Multigrain Bread" "Bread"
    3 1 5 "Corn Flakes" "Cereal"
    3 1 6 "Orange Juice" "Drink"
    3 1 7 "Milk" "Drink"
    

    etc.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a table called restaurants which contains each restaurant information, I want to
I have 2 classes which hold data for restaurants. Status.cs public class Status {
I have an application which keeps database of all nearby restaurants. When adding a
If I have a bunch of restaurants in my db, and each restaurant can
I have a database of restaurants which I do a full-text search on. The
Not sure why I can't figure this one out. Basically, I have two tables
This one should be easy. I have @restaurants which contains a selected number of
I have a little complex Database model on which i am not able to
I have a few models which are not in the default cakephp format user(id,
I have a Array list which contains Objects of Restaurants ArrayList<Restaurants> array_sort = new

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.