I have a table of data which gives characteristics of a product.
size: small, big, massive etc.
color: brown, blue, green etc.
Each product is either a parent or a child
If a child doesn't have a color specified in the record then it inherits the color from its parent.
The same for sizes.
Each parent has colors and sizes specified.
How can I construct an sql statement so that I can get all products (including parents) which are blue and also large. Obviously the sql statement must take into account that some products will have to inherit whilst others will have.
(I am using PHP and mySQL)