From 8f8482ca14ce332722daec26ad8bff9c20bf9220 Mon Sep 17 00:00:00 2001 From: itsAbilash <102655634+itsAbilash@users.noreply.github.com> Date: Mon, 27 Jan 2025 11:45:52 -0600 Subject: [PATCH 1/3] Create Customers_who_Bought_All_Products --- Customers_who_Bought_All_Products | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Customers_who_Bought_All_Products diff --git a/Customers_who_Bought_All_Products b/Customers_who_Bought_All_Products new file mode 100644 index 0000000..2cc9f34 --- /dev/null +++ b/Customers_who_Bought_All_Products @@ -0,0 +1,2 @@ +select customer_id from customer group by customer_id +having count(distinct product_key) = (select count(*) from product) From 442c72ae12cfa08b349c08511b5d8821f5e86ca6 Mon Sep 17 00:00:00 2001 From: itsAbilash <102655634+itsAbilash@users.noreply.github.com> Date: Mon, 27 Jan 2025 11:46:10 -0600 Subject: [PATCH 2/3] Rename Customers_who_Bought_All_Products to Customers_who_Bought_All_Products.txt --- ...o_Bought_All_Products => Customers_who_Bought_All_Products.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename Customers_who_Bought_All_Products => Customers_who_Bought_All_Products.txt (100%) diff --git a/Customers_who_Bought_All_Products b/Customers_who_Bought_All_Products.txt similarity index 100% rename from Customers_who_Bought_All_Products rename to Customers_who_Bought_All_Products.txt From b92c6b0fcf2620b0d74df4f118d3c1dd15b9052c Mon Sep 17 00:00:00 2001 From: itsAbilash <102655634+itsAbilash@users.noreply.github.com> Date: Mon, 27 Jan 2025 11:58:33 -0600 Subject: [PATCH 3/3] Create Product_Sales_Analysis_III.txt --- Product_Sales_Analysis_III.txt | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 Product_Sales_Analysis_III.txt diff --git a/Product_Sales_Analysis_III.txt b/Product_Sales_Analysis_III.txt new file mode 100644 index 0000000..0ee848c --- /dev/null +++ b/Product_Sales_Analysis_III.txt @@ -0,0 +1,2 @@ +with cte as (select product_id,year,quantity,price, rank() over(partition by product_id order by year) as rnk from sales) +select product_id, year as first_year, quantity, price from cte where rnk = 1;