PROJECT 01ยทIntermediate

E-Commerce Sales Analysis

TechCart ยท E-Commerce ยท 15 Tasks ยท ~90 min

You'll need a free account to save your progress.

Welcome to TechCart

You've just been hired as a Junior Data Analyst at TechCart, a fictional Indian e-commerce company. Customers visit the platform, place orders, make payments, and buy products across dozens of categories.

The management team relies on the Data Analytics department to guide every major business decision โ€” and now that includes you.

Your job is to analyze TechCart's sales data and answer real business questions using SQL. You won't be learning new concepts โ€” you'll be applying everything you already know to solve problems that matter.

This project is your bridge from learner to practitioner.

โ€œGood morning! We have our weekly management meeting in one hour. I need several reports about our sales, customers, products, and payments. Can you prepare them?โ€

It's Monday morning. Your manager needs answers โ€” fast. This project walks you through 15 real analytical tasks, each representing a request that Data Analysts receive in their daily work. You have one hour. Let's get to it.

What You'll Do

๐Ÿ’ฐ
Revenue
How much has the company generated from successful payments?
๐Ÿง‘โ€๐Ÿคโ€๐Ÿง‘
Customers
Who are our best customers, and which ones are at risk of going inactive?
๐Ÿ“ฆ
Products
Which products and categories drive the most sales and revenue?
๐Ÿ’ณ
Payments
What payment methods are most popular, and how many transactions failed?
๐Ÿ“ˆ
Trends
What daily, monthly, and behavioral patterns can we identify in our data?

The 15 Tasks

Each request below comes from a TechCart department. Hints and the checked answer open inside the project.

  1. Task 1

    Total Revenue

    Finance

    The CEO wants to know: "How much revenue has our company generated from successful, delivered orders?" Base your answer on order line items (order_items), not the orders.total column โ€” Finance reports revenue before customer discounts, and orders.total is the amount after the discount. Only include orders with status 'delivered'.

  2. Task 2

    Monthly Revenue Report

    Finance

    The Finance department needs a monthly revenue breakdown (from delivered orders) to track performance over time. Return each month and its revenue, sorted from oldest to newest.

  3. Task 3

    Top 10 Customers

    Sales

    The Marketing team wants to reward their highest-spending customers. Return the top 10 customers (by name) and how much they spent on delivered orders, highest spender first.

  4. Task 4

    Top Selling Products

    Merchandising

    The Product team wants to identify their best performers by units sold (delivered orders only). Return the top 10 products and units sold, highest first.

  5. Task 5

    Average Order Value

    Finance

    Management wants to know: "On average, how much does a customer spend per delivered order?" Base this on order line items.

  6. Task 6

    Repeat Customers

    Customer Success

    The CRM team defines a repeat customer as anyone who has placed more than one delivered order. How many repeat customers does TechCart have?

  7. Task 7

    Customer Lifetime Value

    Marketing

    The CEO wants the total value every customer has brought to the business (lifetime value = total spend across all their delivered orders). Return every customer with their lifetime value, highest first.

  8. Task 8

    Revenue by Category

    Merchandising

    Which product categories generate the highest revenue from delivered orders? This helps the business decide where to invest in inventory and marketing.

  9. Task 9

    Failed Payments

    Finance / Risk

    The Finance team needs to investigate failed transactions. List every failed payment with its order id, customer name, amount, and payment date.

  10. Task 10

    Daily Sales Trend

    Operations

    The CEO wants to monitor revenue day by day. Return delivered-order revenue for every date, sorted chronologically.

  11. Task 11

    Best Selling Product

    Merchandising

    Find the single product that has sold the most units overall (delivered orders only).

  12. Task 12

    Revenue by Payment Method

    Finance

    Management wants to understand how customers prefer to pay. Break down revenue from successful payments by payment method, highest revenue first.

  13. Task 13

    Customer Purchase Frequency

    Customer Success

    Marketing wants to understand buying behavior patterns. For each customer, count how many successful payments they have made. (Optional bonus, not required to pass: also show their total amount paid โ€” average days between purchases is a nice-to-have, not graded.)

  14. Task 14

    Highest Single Order

    Finance

    Find the single highest-value delivered order ever placed at TechCart (by total line-item value), and who placed it.

  15. Task 15

    Executive Sales Dashboard

    Executive

    Consolidate everything you've found into a single executive dashboard. No new SQL query is required here โ€” once all 12 KPIs below are unlocked by completing their source tasks, review the dashboard and submit it to close out the project.

SQL Skills You'll Apply

Querying & Filtering
WHEREHAVINGCASE WHEN
Aggregation & Grouping
Aggregate FunctionsGROUP BYORDER BYLIMIT
Joins & Relationships
INNER JOINMultiple JOINsPrimary KeysForeign Keys
Advanced Techniques
CTEsWindow FunctionsViewsUNIONDate FunctionsString Functions

The Database

TechCart is a fictional company. Its e-commerce database (ecommerce) is the same SQLite practice database used by the Playground, the challenges and the lessons.

users
Registered customers
id, first_name, last_name, email, city, country, created_at, status, is_premium
orders
Customer orders
id, user_id, total, discount, item_count, status, order_date, shipped_date, shipping_city, shipping_country
products
Product catalog
id, name, category, price, cost, stock, status, rating
order_items
Line items linking orders to products (bridge table)
id, order_id, product_id, quantity, unit_price, subtotal
payments
Payment transactions
id, order_id, user_id, amount, method, status, paid_at

Lessons to Review First

Each task builds on a topic from the lessons. If one feels unfamiliar, review it and come back, or warm up in the SQL Playground and the practice challenges.