Emmanuella Alao
Data Analyst | Business Intelligence Analyst | AI Solutions Developer
A SQL-driven analysis of retail transaction data, digging into what actually generates revenue, who the highest-value customers are, and how performance differs across branches. No dashboard here, just queries doing the heavy lifting: joins, aggregates, and CASE logic turning raw transaction rows into answers a business can act on.
Retail businesses generate transaction data constantly, but raw rows in a sales_transactions table don't tell you which products are carrying the business, which customers are worth retaining, or which branches need attention. This project uses SQL directly against the data to answer those questions.
- MySQL
- SQL
Retail Sales Dataset — transactional data spanning three related tables: sales_transactions, customers, and products.
- Queried transactional sales data directly in MySQL
- Joined
sales_transactionswithcustomersandproductsto combine sales, customer, and product-level detail - Used aggregate functions (
SUM),GROUP BY, andORDER BY ... LIMITto rank performance - Segmented transactions into spending bands using CASE logic to identify top-performing customers and products
- Broke down revenue by branch, category, and customer to surface where value is concentrated
Revenue is heavily concentrated in Electronics. Electronics generated £800,000 in revenue — more than six times Fashion (£115,000) and Food (£114,000), and over 30x Home Care (£23,000). Category performance here isn't close; Electronics is carrying the business.
A handful of customers drive most of the value. The top 3 customers by revenue show a steep drop-off: Customer 3 at £550,000, Customer 2 at £250,000, and Customer 1 at £90,000. The top customer alone generated more than the second and third combined — a strong signal for where a loyalty or retention program would pay off first.
-- Top 3 Customers by Revenue
SELECT c.customer_id, SUM(unit_price * quantity) AS revenue
FROM sales_transactions s
JOIN customers c ON c.customer_id = s.customer_id
GROUP BY c.customer_id
ORDER BY revenue DESC
LIMIT 3;
-- Revenue by Category
SELECT p.category, SUM(s.unit_price * s.quantity) AS revenue
FROM sales_transactions s
JOIN products p ON s.product_id = p.product_id
GROUP BY p.category
ORDER BY revenue DESC;Not applicable here — this project intentionally works directly against structured data in SQL rather than a spreadsheet layer, since multi-table joins and aggregate logic at this scale are a better fit for a query engine than pivot tables.
retail_sales_analysis.sqlREADME.md
Emmanuella Alao Data Analyst | Business Intelligence Analyst | AI Solutions Developer


