How can I select the required records?
- by simple
Tables:
Product: [id, name, brand_id, is_published]
Brand: [id, name, is_published]
Awards: [id, name]
ProductAwards [product_id, award_id]
How do I select the list of PUBLISHED brands along with the number of AWARDS of brand's products that are Published.
I am cool with all the part except issuing the "is_published" restriction when counting Awards.
I hope this is clear; can anyone just suggest where to dig?