Skip to content

You're working for a company that sells motorcycle parts, and they've asked for some help in analyzing their sales data!

They operate three warehouses in the area, selling both retail and wholesale. They offer a variety of parts and accept credit cards, cash, and bank transfer as payment methods. However, each payment type incurs a different fee.

The board of directors wants to gain a better understanding of wholesale revenue by product line, and how this varies month-to-month and across warehouses. You have been tasked with calculating net revenue for each product line and grouping results by month and warehouse. The results should be filtered so that only "Wholesale" orders are included.

They have provided you with access to their database, which contains the following table called sales:

Sales

ColumnData typeDescription
order_numberVARCHARUnique order number.
dateDATEDate of the order, from June to August 2021.
warehouseVARCHARThe warehouse that the order was made from— North, Central, or West.
client_typeVARCHARWhether the order was Retail or Wholesale.
product_lineVARCHARType of product ordered.
quantityINTNumber of products ordered.
unit_priceFLOATPrice per product (dollars).
totalFLOATTotal price of the order (dollars).
paymentVARCHARPayment method—Credit card, Transfer, or Cash.
payment_feeFLOATPercentage of total charged as a result of the payment method.

Your query output should be presented in the following format:

product_linemonthwarehousenet_revenue
product_one---------
product_one---------
product_one---------
product_one---------
product_one---------
product_one---------
product_two---------
............
Spinner
DataFrameas
df9
variable
-- Analysis of Payment Fees

SELECT AVG(payment_fee) AS avg_fees, 
	MIN(payment_fee) AS min_fee, 
	MAX(payment_fee) AS max_fee, 
	SUM(payment_fee) AS total_fee
FROM public.sales;

--Analysis of Payment Fees Data Key Insights:

  • The average payment fee across all transactions is approximately $0.022 (or 2.2 cents).
  • The minimum fee observed is $0, indicating some transactions might have no fee.
  • The maximum fee observed is $0.03 (or 3 cents).
  • The total sum of all payment fees is $22.02.

Implications:

  1. Low Individual Transaction Cost: The payment fees are very low, with a maximum of 3 cents per transaction. This indicates that individual transaction fees are not a significant expense for single sales.

  2. Cumulative Impact: Although the individual fees are minor, the total fee of $22.02 shows that these small fees can accumulate. Depending on the volume of transactions, even minor fees can add up to a considerable amount over time.

  3. Potential for Fee-Free Transactions: The minimum fee of $0 suggests that certain payment methods or transaction types do not incur fees. Identifying these could present an opportunity for optimization.

Recommendations to Senior Managers: Promote Low-Fee Payment Methods:

  • Action: Explore strategies to encourage customers to use payment methods with lower or no fees. This could include offering small incentives or providing clearer communication regarding payment options.
  • Justification: Encouraging customers to adopt more cost-effective payment methods can directly reduce overall transaction costs.

Negotiate with Payment Providers:

  • Action: If certain payment methods (such as credit card processing) consistently incur high fees, investigate the possibility of negotiating better rates with the payment service providers.
  • Justification: Even a small reduction in percentage fees can lead to substantial savings over a large volume of transactions.

Review Fee Structure for $0 Fee Transactions:

  • Action: Understand why some transactions have a $0 fee. Are they associated with cash payments? Are there specific types of bank transfers that are free? Document these processes.
  • Justification: Gaining this knowledge can help promote these methods or replicate the conditions that result in fee-free transactions when feasible.
Spinner
DataFrameas
df11
variable
-- Overall Sales & Revenue Distribution

SELECT AVG(total) AS avg_sales, 
	MIN(total) AS min_sale, 
	MAX(total) AS max_sale, 
	SUM(total) AS total_sales
FROM public.sales;

Key Insights from Sales and Revenue Data

  • The average transaction or sale value is $289.11.
  • The smallest transaction is $10.43, likely representing low-margin items or discounted sales.
  • The largest transaction is $2,546.33, signifying a high-value purchase or bulk order.
  • The total revenue generated for the period is $289,113.
  • 1,000 transactions occurred during the period under review (calculated by 289.11 ≈ 1,000).

Implications for Senior Managers Revenue Volatility Risk:

  • A heavy reliance on a few large or high-value transactions (such as the $2.5K sale) creates a vulnerability. For example, losing just five high-value customers could lead to a revenue decrease of 10-15%.

Low-Value Transaction Inefficiency:

  • Sales around $10.35 are likely unprofitable, although this depends on the cost of materials.

Untapped Pricing Potential:

  • The significant gap between minimum and maximum sales (ranging from 2.5K) indicates inconsistent pricing or missed opportunities for upselling.

Recommendations: 1. Stabilize Revenue Streams For instance, launching loyalty tiers: - Bronze (200+): 5% discount - Gold ($1K+): a dedicated account manager

The goal is to increase repeat purchases from mid-tier buyers by 25%.

2. Eliminate Profit-Draining Sales By implementing minimum order quantity (MOQ). For example, setting the floor at $25 (below-cost transactions blocked).

3. Bundle low-value items:

For example, creating a "$50 starter " to boost average order value or quantity.

Spinner
DataFrameas
df10
variable
--Revenue Trends by Client Type

SELECT client_type, 
	ROUND(SUM(total), 2) AS total_sales_revenue 
FROM sales 
	GROUP BY client_type;

Analysis of Sales Trends by Client Type

Key Insights:

  • The "Wholesale" client type generates significantly more revenue (129,470.67).
  • However, while wholesale clients represent 55.2% of total sales, retail clients still contribute a substantial 44.8% of revenue, indicating that both segments are important to the company’s overall sales.

Business Implications:

  1. Strategic Focus on Wholesale: The higher revenue from wholesale clients suggests that this segment is a primary driver of the company's top line. Implementing strategies to grow or optimize wholesale operations could yield significant returns.

  2. Retail Potential: Although the retail segment generates less revenue, its contribution is still considerable. There may be untapped potential or opportunities to increase its revenue through targeted initiatives.

  3. Resource Allocation: Decisions regarding marketing expenditure, sales team focus, inventory management, and operational support should take into account the current revenue contributions of each client type.

Recommendations for Senior Managers: Diversification of Revenue Streams

  1. Initiate retail strategies, such as optimizing e-commerce platforms and implementing loyalty programs, to decrease reliance on wholesale channels.
  2. Explore hybrid business models, including partnerships with premium retailers for exclusive offerings.

Retail Gap Analysis

  1. Identify and analyze the underlying factors contributing to suboptimal retail performance, focusing on aspects such as pricing strategies, marketing initiatives, and distribution efficacy.
  2. Evaluate the effectiveness of targeted promotions and consider store refurbishments aimed at enhancing customer traffic and engagement.
Spinner
DataFrameas
df12
variable
--Average Payment Fees by Method

SELECT payment AS payment_method, 
	AVG(payment_fee) AS avg_fee 
FROM sales 
	GROUP BY payment_method;
Spinner
DataFrameas
df13
variable
--Total Payment Fees by Method

SELECT payment AS payment_method, 
	SUM(payment_fee)*100 AS total_fees 
FROM sales 
	GROUP BY payment_method;
Spinner
DataFrameas
df14
variable
--Categorical Distribution (Frequencies)

SELECT client_type, 
	COUNT(*) 
FROM sales 
	GROUP BY client_type; 
Spinner
DataFrameas
df15
variable
--Categorical Distribution (Frequencies)

SELECT product_line, 
	COUNT(*) 
FROM sales 
	GROUP BY product_line;

Key Performance Indicators (KPIs) and Metrics

  1. Net revenue
  2. Wholesale revenue by product line
  3. Payment Method Cost Efficiency
Spinner
DataFrameas
df16
variable
--NET REVENUE
--The core metric (total sales - payment_fee). 
--This shows the actual income after transactional costs.

SELECT 
	ROUND(SUM((total) * (1 - payment_fee)), 2) AS net_revenue
FROM public.sales;

Overall Net Revenue Analysis Key Insight:

  • The total net revenue for the period stands at $284,208.43.

Implication:

  • This amount reflects the company's earnings after accounting for certain direct costs, such as payment fees previously discussed.
  • It serves as a vital indicator of the overall financial health and profitability of sales operations.
  • However, it's important to note that this net revenue figure does not encompass all business expenses, including the cost of goods sold, operational overhead, marketing, salaries, and rent. Thus, while it marks progress toward profitability, it doesn't represent the final profit.

Recommendations to Senior Managers: Establish Performance Benchmarks:

  • Action: Set clear benchmarks for net revenue that incorporate historical performance data — e.g., monthly, quarterly, and annually — and establish realistic targets aligned with business goals.
  • Justification: A single revenue figure lacks actionable context. Benchmarks enable performance evaluation (Is $284K a good figure?) and help identify trends in growth or decline.
Spinner
DataFrameas
revenue_by_product_line
variable
--WHOLESALE REVENUE BY PRODUCT LINE

SELECT product_line,
    CASE WHEN EXTRACT('month' from date) = 6 THEN 'June'
        WHEN EXTRACT('month' from date) = 7 THEN 'July'
        WHEN EXTRACT('month' from date) = 8 THEN 'August'
    END as month,
    warehouse,
	SUM(total) - SUM(payment_fee) AS net_revenue
FROM sales
WHERE client_type = 'Wholesale'
GROUP BY product_line, warehouse, month
ORDER BY product_line, month, net_revenue DESC