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

  • SEARCH
  • Home
  • 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 9168089
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T15:32:55+00:00 2026-06-17T15:32:55+00:00

I have created a database schema but I am not sure if it is

  • 0

I have created a database schema but I am not sure if it is really optimized.
Can someone please have a look at it and help me to optimize it?

It has tables Categories which will contains value like "Pizza, Salat, Pasta, Drinks".

Sizes table will contain each categoy sizes like Pizza may have sizes small,large,family,party.

And prices table will contain product_id,size_id,price.

But I am not sure if the sizes should be joined to products table or to categories as I did.

  • 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-06-17T15:32:56+00:00Added an answer on June 17, 2026 at 3:32 pm

    Your design may, of course, all be a perfect reflection of your underlying business domain – you don’t really give enough information to help us decide either way. I’d encourage you to phrase the schema in words, first – this usually helps understand the relationships a bit better.

    I think your domain works roughly as follows:

    • One category has 1 or more products.
    • One product belongs to exactly one category.
    • One product is available in 1 or more sizes.
    • The base price of a product is determined by its size.
    • Some, but not all, products have toppings.
    • Some, but not all, products can be customized by adding additional toppings.
    • The total price of some customized products is determined by the base price, plus the sum of the additional toppings.
    • The total price of some customized products is determined by the base price, plus the sum of the additional toppings for the product size.
    • Toppings can be added to one or more product.
    • Products can have zero or more toppings added to them.

    This is sorta kinda what you’re showing in your design, except you show that it’s product category, not product, which determines which size is available. That might be right. The way to answer the question is “are there product categories in which not all products are available in the same sizes?” I think there are – drinks manufacturers, for instance, sell drinks in a range of container sizes.

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

Sidebar

Related Questions

We have a database with a very simple schema: CREATE TABLE IF NOT EXISTS
I have created a partition function but I am not able to apply it
I apologise for the confusing title but I'm really not sure how to describe
I am using paperclip, but not sure how to seed with/without it. I have
I have created my database by this sql query: (CREATE DATABASE + DBName +
I have created a database of my movies and another with my actors in
I have created my database, and used cake bake my_project to create my project,
I have created SQL Server database by Visual Studio 2010 Ultimate means in Visual
I have created a MySQL database using MySQL Workbench. It has about 20 tables.
I have created the following database layout, and started coding the application. The more

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.