Back to problems

Write SQL with HAVING and efficient joins

SQL · Meta · Medium

You are given two relational tables whose columns are listed below. products(product_id INT PRIMARY KEY, country VARCHAR(2), category VARCHAR(50)) interactions(product_id INT, buyer_id INT, seller_id INT, interaction_date DATE, interaction_type VARCHAR(20), interaction_count INT) Part A. Using only the interactions table, produce a single-row result with one column named product_count. A product qualifies only when its distinct buyer_id count over the entire history is…

Checking your access…