eCommerce Dataset
Overview
In this guide, you’ll learn how to use the Oxla database with eCommerce datasets through various sample queries. These datasets include information about sales transactions, such as customer details, supplier data, and order details.
You’ll explore how to analyze data by joining related tables and running queries to support informed decision-making for your business.
Data Source: https://github.com/apache/doris/tree/master/tools/ssb-tools .
Ensure you’ve created the Data Storage with the appropriate demo dataset, the Cluster is running, and you’re connected to it using the PostgreSQL client. For more details, refer to the Quickstart - Oxla SaaS page.
Datasets Structure
Let’s explore the tables and their structures to understand better and fully utilize the eCommerce dataset.
Sample Queries
Sample 1: Find Customers with the Most Total Order
This example calculates the total order quantity for each customer by joining the customer
and lineorder
tables.
The result displays the 10 customer names with the highest total order quantity.
Sample 2: Average Order Quantity and Revenue per Customer
In this example, we aim to retrieve the average order quantity and revenue per customer. We will use the LIMIT
clause to find the top 5 customers based on their revenue.
This query displays the average order quantities and revenues for the top 5 customers.
Sample 3: Find the Top 3 Sold Parts
This query lists the top 3 parts by total revenue and total quantity sold.
It displays the 3 parts that are most sold based on the quantity sold.
Sample 4: Monthly Revenue and Order Count per Supplier
This example shows how to calculate each supplier’s monthly revenue and order count.
You will get the total revenue for each supplier during the respective period.