diff --git a/customers_who_bought.sql b/customers_who_bought.sql new file mode 100644 index 0000000..590ef9f --- /dev/null +++ b/customers_who_bought.sql @@ -0,0 +1,2 @@ +select customer_id from customer group by customer_id having count (distinct +product_key) = (select count(product_key) FROM product); \ No newline at end of file diff --git a/product_sales_analysis.sql b/product_sales_analysis.sql new file mode 100644 index 0000000..4104ebd --- /dev/null +++ b/product_sales_analysis.sql @@ -0,0 +1,3 @@ +select product_id, year as first_year, quanitity, price from sales where +(product_id, year) in (select product_id, min year) as year from sales +GROUP BY product_id; \ No newline at end of file