1

Topic: Sampling of the goods on a difficult condition

Hello!
Please. Prompt, at me such question.
For example there are 3 tables:
categors:
id | name
========
1 | Chandeliers
2 | the Sconce
3 | Fixtures
4 | Bulbs
products:
id | name | cat_id
========
1 | the Chandelier No1 | 1
2 | the Chandelier No2 | 1
3 | the Sconce No1 | 2
4 | the Sconce No2 | 2
5 | the Fixture No1 | 3
6 | the Fixture No2 | 3
props:
product_id | color
========
1 | Red
2 | Dark blue
3 | Red
4 | Dark blue
5 | Red
6 | White
The task:
It is necessary to select the goods from "the Chandelier" category only that color which goods also are and in section "Sconce" and "Fixtures";
Accordingly we look that we have in Chandelier section, Sconce and Fixtures Red color. It turns out that we need to select the goods: the Chandelier No1, since it of red color which is in all necessary sections.
How it to solve 1 request?
Thanks!

2

Re: Sampling of the goods on a difficult condition

It is necessary to do educational jobs independently. And request simple.