-1

I am trying to draw the table diagram of a product listing web application.

Application logic:

Admin user will create:

  • Categories (must be dynamically created by admin user),
  • Category's attributes (must be dynamically created by admin user),
  • Selection of Category attribute's options (must be dynamically created by admin user)

User will post a product under a specific category and must choose category attribute's option for each category attributes to successfully save the product.

Example: Admin creates category "food"

  • "food" has its attribute "meal_type" and "sugar".
  • "meal_type" has its options "breakfast", "lunch" and "dinner".
  • "sugar" has its options "with-sugar" and "non-sugar".

and now user can post his product "pizza" under category "food". When user chosen "food" category, he must see its attributes "meal_type" and "suger" and then must set those option values.

For example, "pizza"'s category is "food" and "meal_type"="breakfast", "sugar"="with-sugar".

And I want to call these option values together with product details when selecting these items.

I have made this (removed non-related fields)

enter image description here

but I am not sure this will work and be efficient at same time.

What is the most efficient relational schema (or ERD) for case like this?

philipxy
  • 14,416
  • 5
  • 32
  • 77
Asagao
  • 44
  • 6
  • [Why should I not upload images of code/data/errors when asking a question?](https://meta.stackoverflow.com/q/285551/3404097) [Why are images of text, code and mathematical expressions discouraged?](https://meta.stackexchange.com/q/320052/266284) – philipxy May 26 '22 at 18:45
  • Voting is anonymous. ERD content in text DDL. Please research before considering posting. [How to design a product table for many kinds of product where each product has many parameters](https://stackoverflow.com/q/695752/3404097) [More](https://stackoverflow.com/a/2945124/3404097) [And more](https://stackoverflow.com/q/5106335/3404097) [Re EAV](https://stackoverflow.com/a/23950836/3404097) etc etc etc [How much research effort is expected of Stack Overflow users?](https://meta.stackoverflow.com/q/261592/3404097) [ask] [Help] – philipxy May 27 '22 at 01:21

0 Answers0