Dataset: Olist E-commerce Database (SQLite)
Objective:
Use SQL queries to extract and analyze data from the Olist E-commerce database.
The task includes using SELECT statements, filtering, ordering, grouping, joins, subqueries, aggregate functions, creating views, and optimizing queries with indexes.
- Retrieved data from the
customerstable. - Filtered customers by state and ordered by city.
- Counted total customers by state.
- Counted orders per month using
GROUP BYandstrftime.
- Used
INNER JOINto combine orders and customer information. - Used
LEFT JOINto find customers who did not have any orders.
- Identified customers with more than 2 orders.
- Retrieved detailed information of these customers using a subquery.
- Calculated total payment per order from
order_paymentstable. - Calculated average review score from
order_reviewstable.
- Created a view
vw_customer_spendingshowing total spending of each customer. - Retrieved top 10 customers by total spending from the view.
- Created an index on
orders.order_purchase_timestampto speed up date-based queries. - Verified index usage using
EXPLAIN QUERY PLAN.
- Learned to manipulate and query structured data using SQL.
- Practiced filtering, grouping, joining tables, using subqueries, aggregations, views, and indexes.
- Generated visual outputs (screenshots) of SQL queries for analysis.