I have four tables, for example:
Cars: car_id | make_id 1 | 1 2 | 3 Cars Makes make_id | make_name 1 | BMW 2 | Ferrari 3 | Mercedes Car Properties car_id | property_id | property_value 1 | 1 | Automatic 1 | 2 | 1000 1 | 3 | Diesel 2 | 1 | Manual 2 | 2 | 15000 2 | 3 | Gasoline Properties property_id | property_name 1 | Transmission 2 | Mileage 3 | Fuel
As you can see, each car has a make_id from the “Does” table.
And there is a separate table that contains all the basic properties of cars. Then there is the table "Car Properties", which contains car_id, property_id, property_value
Now I want to make the following request: get BMW cars with an automatic transmission, and mileage - 1000 with diesel. let the form provide the following: make_id = 1 (BMW) properties = Automatic, 1000, Diesel
PS: It will be ok if I just get the result car_id
source share