SELECT SUM(QTY_SOLD * (UNIT_PRICE - DISCOUNT)) AS Total_Sales_Last_Quarter FROM GenAI_ORDER_DETAIL WHERE ORDER_DATE >= (SELECT TOP 1 LQ_DAY_DATE FROM GenAI_LU_DAY WHERE YEAR_ID = 2023 ORDER BY DAY_DATE DESC) AND ORDER_DATE <= (SELECT TOP 1 DAY_DATE FROM GenAI_LU_DAY WHERE YEAR_ID = 2023 ORDER BY DAY_DATE DESC)
stringlengths
34
815
Total Sales, 2023 Q4.
stringlengths
15
41
SELECT TOP 1 ITEM_NAME, SUM(Total_Quantity_Sold) AS Total_Quantity_Sold FROM GenAI_Orders WHERE QUARTER_ID = '4' AND Year = 2023 GROUP BY ITEM_NAME ORDER BY Total_Quantity_Sold DESC
Top Selling, 2023 Q4.
SELECT TOP 1 SUPPLIER_ID, SUPPLIER_NAME FROM GenAI_Orders WHERE ITEM_ID = 292 AND QUARTER_ID = '4' AND Year = 2023 GROUP BY SUPPLIER_ID, SUPPLIER_NAME
Supplier, Top Selling, 2023 Q4.
SELECT TOP 1 ITEM_ID, ITEM_NAME, SUM(Total_Quantity_Sold) AS Total_Quantity FROM GenAI_Orders WHERE Year = 2023 GROUP BY ITEM_ID, ITEM_NAME ORDER BY Total_Quantity DESC
Top Selling, 2023.
SELECT TOP 1 PROMOTION_ID, Promotion_Description, Promotion_Type_ID, Promotion_Type_Description, COUNT(PROMOTION_ID) AS Promotion_Count FROM GenAI_Orders WHERE Year = 2023 AND QUARTER_ID = '4' AND ITEM_ID = 292 GROUP BY PROMOTION_ID, Promotion_Description, Promotion_Type_ID, Promotion_Type_Description ORDER BY Promotion_Count DESC;
Top Selling, Promotion, 2023 Q4.
SELECT SUM(Total_Quantity_Sold) AS Total_Units_Sold_Previous_Quarter FROM GenAI_Orders WHERE QUARTER_ID = '3' AND Year = 2023
Units Sold, 2023 Q3.
SELECT ld.MONTH_ID, SUM((od.QTY_SOLD * od.UNIT_PRICE) - od.DISCOUNT) AS Monthly_Sales FROM GenAI_ORDER_DETAIL AS od INNER JOIN GenAI_LU_DAY AS ld ON CAST(od.ORDER_DATE AS DATE) = CAST(ld.DAY_DATE AS DATE) WHERE ld.QUARTER_ID = ( SELECT MAX(QUARTER_ID) FROM GenAI_LU_DAY WHERE YEAR_ID = 2023 AND QUARTER_ID < 20234 ) GROUP BY ld.MONTH_ID ORDER BY ld.MONTH_ID
Monthly Sales, 2023 Q3.
SELECT TOP 1 CATEGORY_ID, Category_Description FROM GenAI_Orders GROUP BY CATEGORY_ID, Category_Description ORDER BY SUM(Total_Sales_Value) DESC
Top Selling, Category.
SELECT COUNT(DISTINCT SUPPLIER_NAME) AS NumberOfDifferentSuppliers FROM ( SELECT TOP 3 ITEM_NAME FROM GenAI_Orders WHERE QUARTER_ID = '4' AND Year = 2023 GROUP BY ITEM_NAME ORDER BY SUM(Total_Quantity_Sold) DESC ) AS TopSellingItems JOIN GenAI_Orders ON GenAI_Orders.ITEM_NAME = TopSellingItems.ITEM_NAME
Suppliers, Top Selling, 2023 Q4.
SELECT AVG(Total_Sales_Value) AS Average_Transaction_Value FROM GenAI_Orders WHERE YEAR(DAY_DATE) = 2023 AND MONTH(DAY_DATE) = 11
Average Transaction Value, November 2023.
SELECT SUM(Total_Discount_Amount) AS Total_Discount_Amount FROM GenAI_Orders WHERE YEAR(DAY_DATE) = 2023;
Discount Amount, 2023.
SELECT SUM(Total_Sales_Value) AS Total_Sales_Value_Northeast FROM GenAI_Orders WHERE Year >= 2018 AND Call_Center_Country_Name = 'Northeast'
Total Sales, Northeast, Since 2018.
SELECT TOP 1 WITH TIES ITEM_ID, YEAR_ID, MONTH_ID, SUM(QTY_SOLD * (UNIT_PRICE - DISCOUNT)) AS TOTAL_SALES FROM GenAI_ORDER_DETAIL JOIN GenAI_LU_DAY ON CONVERT(date, ORDER_DATE) = DAY_DATE WHERE YEAR_ID = 2022 GROUP BY ITEM_ID, YEAR_ID, MONTH_ID ORDER BY SUM(QTY_SOLD * (UNIT_PRICE - DISCOUNT)) DESC
Top Selling, Monthly Sales, 2022.
SELECT TOP 5 od.ITEM_ID, SUM((od.QTY_SOLD * od.UNIT_PRICE) - od.DISCOUNT) AS Product_Sales FROM GenAI_ORDER_DETAIL AS od INNER JOIN GenAI_LU_DAY AS ld ON CAST(od.ORDER_DATE AS DATE) = CAST(ld.DAY_DATE AS DATE) WHERE ld.QUARTER_ID = ( SELECT MAX(QUARTER_ID) FROM GenAI_LU_DAY WHERE YEAR_ID = 2023 AND QUARTER_ID < 20234 ) GROUP BY od.ITEM_ID ORDER BY Product_Sales DESC
Top Selling, Products, Sales, 2023 Q3.
SELECT SUM(Total_Sales_Value) AS Total_Revenue_Three_Months FROM GenAI_Orders WHERE Year = 2023 AND MONTH_ID IN ('10', '11', '12');
Revenue, 2023 Q4.
SELECT TOP 1 LU_EMPLOYEE.EMP_ID, LU_EMPLOYEE.EMP_FIRST_NAME, LU_EMPLOYEE.EMP_LAST_NAME, LU_EMPLOYEE.FTE_FLAG, SUM(GenAI_ORDER_DETAIL.QTY_SOLD * (GenAI_ORDER_DETAIL.UNIT_PRICE - GenAI_ORDER_DETAIL.DISCOUNT)) AS Total_Sales FROM GenAI_ORDER_DETAIL JOIN LU_EMPLOYEE ON GenAI_ORDER_DETAIL.EMP_ID = LU_EMPLOYEE.EMP_ID WHERE GenAI_ORDER_DETAIL.ITEM_ID = 292 AND GenAI_ORDER_DETAIL.ORDER_DATE >= (SELECT TOP 1 GenAI_LU_DAY.LQ_DAY_DATE FROM GenAI_LU_DAY WHERE YEAR_ID = 2023 ORDER BY DAY_DATE DESC) AND GenAI_ORDER_DETAIL.ORDER_DATE <= (SELECT TOP 1 GenAI_LU_DAY.DAY_DATE FROM GenAI_LU_DAY WHERE YEAR_ID = 2023 ORDER BY DAY_DATE DESC) GROUP BY LU_EMPLOYEE.EMP_ID, LU_EMPLOYEE.EMP_FIRST_NAME, LU_EMPLOYEE.EMP_LAST_NAME, LU_EMPLOYEE.FTE_FLAG ORDER BY Total_Sales DESC
Top Selling, Employee, 2023 Q4.
SELECT COUNT(DISTINCT ITEM_ID) AS Unique_Items_Sold_Last_Quarter FROM GenAI_Orders WHERE Year = 2023 AND QUARTER_ID = '4'
Sales, 2023 Q4.
SELECT COUNT(ORDER_ID) AS Total_Orders_Last_Quarter FROM GenAI_Orders WHERE Year = 2023 AND QUARTER_ID = '4'
Total Orders, 2023 Q4.
SELECT PROMOTION_ID, Promotion_Description, COUNT(ORDER_ID) * 100.0 / SUM(COUNT(ORDER_ID)) OVER() AS Percentage_Of_Orders FROM GenAI_Orders WHERE Year = 2023 AND ITEM_ID = 174 GROUP BY PROMOTION_ID, Promotion_Description
Promotion, 2023.
SELECT TOP 100 * FROM GenAI_Orders
Promotion, Orders Percentage.
SELECT TOP 1 Call_Center_Name, SUM(Total_Sales_Value) AS TotalSales FROM GenAI_Orders GROUP BY Call_Center_Name ORDER BY TotalSales DESC
Top Selling, Call Center, Total Sales.