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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T09:08:33+00:00 2026-05-12T09:08:33+00:00

Sorry for the bad title, but I have no idea how to put this

  • 0

Sorry for the bad title, but I have no idea how to put this in short. The Problem is the following:

I have a generic item that represents a group, lets call it Car. Now this Car has attributes, that range within certain limits, lets say for example speed is between 0 and 180 for a usual Car. Imagine some more attributes with ranges here, for example Color is between 0 and 255 whatever that value might stand for.

So in my table GenericItems I have:

ID    Name

 1    Car

And in my Attributes I have:

ID   Name   Min_Value    Max Value
 1   Speed     0            180
 2   Color     0            255

The relation between Car and Attributes is thus 1:n.

Now I start having very specific instances of my Car for example a FordMustang, A FerrariF40, and a DodgeViper.
These are specific instances and now I want to give them specific values for their attributes.

So in my table SpecificItem I have:

ID    Name           GenericItem_ID

 1    FordMustang         1
 2    DodgeViper          1
 3    FerrariF40          1

Now I need a third table SpecificAttributes2SpecificItems, to match attributes to SpecificItems:

ID    SpecificItem_ID   Attribute_ID   Value

 1         1                1           120        ;Ford Mustang goes 120 only
 2         1                2           123        ;Ford Mustang is red
 3         2                1           150        ;Dodge Viper goes 150
 4         2                2           255        ;Dodge Viper is white
 5         3                1           180        ;FerrariF40 goes 180
 6         3                2             0        ;FerrariF40 is black

The problem with this design is, as you can see, that I am basically always copying over all rows of attributes, and I feel like this is bad design, inconsistent etc. How can I achieve this logic in a correct, normalized way?

I want to be able to have multiple generic items, with multiple attributes with min/max values as interval, that can be “instantiated” with specific values

  • 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-12T09:08:33+00:00Added an answer on May 12, 2026 at 9:08 am

    It looks like you’re trying to replicate Entity Atribute Value as a design, which leads to a lot of ugly tables (well, usually it is one single table for everything).

    http://en.wikipedia.org/wiki/Entity-attribute-value_model
    http://ycmi.med.yale.edu/nadkarni/Introduction%20to%20EAV%20systems.htm

    Discussing EAV tends to lead to “religious wars” as there are very few good places to use it (many folks say there are zero good places) and there are other folks who think that since it is so very flexible, it should be used everywhere. If I can find the reference I’m looking for, I’ll add it to this.

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

Sidebar

Related Questions

Sorry for the bad title, but anyway. I have a jQuery script that retrieves
Sorry if the title is bad... So my problem is that i got this
Sorry for the bad title, but I don't know how to name this. My
Sorry for the bad question title. Let's say that I have DateRange class that
Sorry for bad english and bad title! I have the table post id title
sorry for the bad title, I don't know how to describe my problem. I
Sorry for my bad English. Just like what I asked. I have this class
hi sorry for the bad title but I'm not 100% sure what I need
Sorry for the vague title, but I wasn't sure how to summarize this in
Sorry, this is a bad question. I don't even know what the title should

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.