I have this three tables:
products TABLE:
id:integer
name:string
features TABLE:
id:integer
name:string
features_products TABLE:
product_id:integer
feature_id:integer
The features_products TABLE
tells me which features have each product. For example:
product_id feature_id
1 3
1 5
3 4
tells me the product 1 has features 3 and 5 and product 3 have feature 4, also, product 2 (if exists) doesn't have features.
My question is, how can I SELECT
all the products from the products TABLE wich have determinated features? For example, SELECT products which have features 3 AND 5
, or SELECT products which have feature 2