DAD-220 · Structured Database Environments
SQL Return Rate Analysis
This project uses SQL against the QuantigrationUpdates database to analyze product return patterns for a product manager. Using multi-table JOIN queries, it surfaces return frequency by state and return percentage by SKU — then interprets those findings, identifies data limitations, and communicates conclusions clearly to a non-technical stakeholder.
Database schema
The analysis draws on three related tables: Orders, RMA (return merchandise authorizations), and Collaborators. The queries use INNER JOIN to connect return records to geographic data and product identifiers.
Query 1: returns by state
SELECT Collaborators.State AS STATE,
COUNT(*) AS RETURN_FREQUENCY
FROM Orders
INNER JOIN RMA
ON Orders.OrderID = RMA.OrderID
INNER JOIN Collaborators
ON Collaborators.CollaboratorID = Orders.CollaboratorID
GROUP BY STATE
ORDER BY RETURN_FREQUENCY DESC;
Findings
Massachusetts shows the highest return frequency in the dataset, followed by Arkansas. This geographic concentration warrants further investigation — it may reflect regional distribution patterns, a high-volume partner concentrated in those states, or a logistics or quality issue specific to that region.
Query 2: returns by product SKU
SELECT Orders.SKU AS SKU,
COUNT(*) * 100 / (SELECT COUNT(*) FROM RMA) AS PERCENTAGE
FROM RMA
INNER JOIN Orders
ON Orders.OrderID = RMA.OrderID
GROUP BY SKU
ORDER BY PERCENTAGE DESC;
Findings
Stakeholder summary
The data gives the product manager two actionable signals. First, Massachusetts is a geographic concentration point for returns and deserves a closer look at whether a single large partner or regional logistics issue is driving volume. Second, BAS-48-1C and the ENT product line are disproportionately represented in returns — this warrants a quality review, customer feedback analysis, and potentially a conversation with the relevant supplier.
Limitations and next steps
| Limitation | Recommended action |
|---|---|
| Return counts not normalized against order volume | Add a total orders subquery to calculate a true return rate percentage per state and SKU |
| No breakdown by customer or partner within states | Add a GROUP BY CollaboratorID query to determine whether a few large accounts drive the Massachusetts concentration |
| No return reason codes in the RMA table | Request that RMA data be enriched with reason codes (defect, shipping damage, wrong item) to enable root cause analysis |
| Time period of data is unspecified | Add a date filter to understand whether return spikes are seasonal or trend-driven |