SELECT COUNT(DISTINCT customerID) as total_customers FROM orders_1 SQL Query: #Menghitung total unik customers yang transaksi di quarter_1 (SELECT productCode, orderNumber, quantity, status, LEFT(productCode, 3) AS categoryIDįROM orders_2 WHERE status = "Shipped") tabel_cįrom the output, the most ordered category product is S18. (SELECT categoryID, COUNT(DISTINCT orderNumber) as total_order, SUM(quantity) as total_penjualan The most ordered category product during second quarter SELECT DISTINCT customerID FROM orders_2)įrom the output, the number of customers that have transaction is decreasing during 2014. WHERE customerID IN(SELECT DISTINCT customerID FROM orders_1 (SELECT customerID, createDate, QUARTER(createDate) AS quarter FROM customer WHERE createDate BETWEEN '' AND '') tabel_b The number of customers that have transaction (SELECT customerID, createDate, QUARTER(createDate) as quarter FROM customer WHERE createDate BETWEEN '' AND '2004-06- 30') tabel_bīased on the table, the number of customers is increasing during 2014. SQL Query: SELECT quarter, COUNT(DISTINCT customerID) AS total_customers SELECT orderNumber, status, quantity, priceEach, "2" AS quarter FROM orders_2) tabel_aīased on the table, total sales and revenue are decreasing during 2014. (SELECT orderNumber, status, quantity, priceEach, "1" AS quarter FROM orders_1 SQL Query: SELECT quarter, SUM(quantity) AS total_penjualan, SUM(quantity * priceEach) AS revenue order_2 : transaction data during second quarter (Apr-Jun 2004).order_1 : transaction data during first quarter (Jan-Mar 2004).Tables in this challenge are in the list bellow:
How many customers that still active transactions?.What categories that the most bought by customers?.How many consumers that have transaction?.Every division representative xyz want to show data and analyst during 2014 (first and second quarter) in the townhall. Every quarter, xyz will held townhall that is a meeting of division representative to review performance during last quarter. As data driven company, xyz policy is always based on data. Xyz is Business to Business (B2B) startup company that sell indirect product to other business end users.