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 6978139
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T17:43:01+00:00 2026-05-27T17:43:01+00:00

I’m designing a db because I need to develop such a CRM, where the

  • 0

I’m designing a db because I need to develop such a CRM, where the users are able to specify new products, products specs and pricing and then let themself to insert orders for that products specified in a previous step. Of course the data inserted needs to be evaluated according to what they specified in the db.

I may be more clear with an example: user1 creates a product “apple”, specifies then “color” and “weight” as attribute specs for that product. Then user1 says that the apple pricing is based on the color and the weight. The apple “yellow” has a price of 1$/weight unit, the “red” apple has a price of 2$/weight unit.

It also creates a product “car” with specs “year”, “model”, “color”, “brand”. And also here it specifies prices combinations.
Finally he creates the product “shirts” with spec “size” but where the price is standard for each size

What’s a good starting point to handle this kind of data?
I was thinking to create a table products (id, name, pricing_type) (pricing_type gives an idea if it’s a fixed pricing or a variable pricing according to some field).
Then productSpecsName (id, relatedProduct FK products (id), name) and productSpecsValue (id, relatedSpecsName FK productSpecsName(id), value, conversion) (conversion tell me how to use that data in the code -such as transform it as integer, float or boolean, because value is always a string).

But this design doesn’t give me as much flexibility as I need, can you help me getting a better design? It’s such an ecommerce but I would like to give the user the opportunity to create custom types.
The first, and probably simplest design I came with is to create a table per product (each time the user needs to add a product I create a new table) or create a mega-table with all possible options and leave them nullable, but I would go with a more flexible option.
Waiting for better ideas/suggestions.

  • 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-27T17:43:01+00:00Added an answer on May 27, 2026 at 5:43 pm

    I think you are looking for Entity–attribute–value model.See this pages as a start:

    • Using Database Metadata and its Semantics to Generate Automatic and Dynamic Web Entry Forms

    • Planning and Implementing a Metadata-Driven Digital Repository

    You can also find useful threads here in SO in the tag: eav

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
I need to clean up various Word 'smart' characters in user input, including but
I need a function that will clean a strings' special characters. I do NOT
I have thousands of HTML files to process using Groovy/Java and I need to
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but

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.