I’m building the functionality to filter results on a new website. Each result contains data from three separate tables (shown below as A, B, and C). The mapping tables (D through K) contains data that the majority of my filters are based on.
I’m looking to return rows with the columns of A.id, A.name, B.rating, C.price where D-K contains certain data on B. The filter content I have is a series of IDs from the mapping tables. I can have as little as no filters, or as many as 20 IDs I’d have to check before returning one A, B, C relationship. Further, there’s a limit of 12 results to display per page.
Just thinking of the above fries my brain. I’ve drawn out the structure of the tables the best I can below. Any help you can offer would be greatly appreciated. Thanks!

.
Schema Information Edit
A: id INT PRIMARY, name VARCHAR(255)
B: id INT PRIMARY, a_id INT, rating FLOAT
C: id INT PRIMARY, b_id INT, price DECIMAL(10, 2)
Mapping Tables D-K: b_id INT, ?_id INT
D-K: id INT PRIMARY, name VARCHAR(255)
Sounds like you want to do some
JOINs.Then, to do filtering from other tables, you’d join them in as well:
Ideally, you only want to join in the tables you actually need to use for any given query – if you’re not filtering on a given field, don’t join in its table.