Welcome & database setup

Welcome to the SQL Bootcamp! Over the coming phases, you will go from writing your very first SELECT statement to building production-ready PostgreSQL queries. And you won't be practicing on toy data. You will query the Olist Brazilian E-commerce dataset: 100,000+ real orders, 9 interconnected tables, and real business questions to answer.

Your 12-module SQL journey

From first SELECT to production PostgreSQL mastery

The Olist dataset is publicly available Brazilian e-commerce data. It contains 9 tables covering customers, orders, order items, products, sellers, payments, reviews, geolocation, and product category translations. This is the same kind of data you would find in a real e-commerce company: messy, interconnected, and full of insights waiting to be discovered.

Olist E-commerce database schema

The 9 tables you will query throughout this course

terminal
bash
# Clone the repo and start the database
git clone https://github.com/learnwithparam/sql-masterclass.git sql-masterclass
cd sql-masterclass
make up          # Start PostgreSQL in Docker
make setup-data  # Download the Olist CSV files
make init-db     # Load data into PostgreSQL

Three commands to get your database running with 100k+ real orders.

Validation checklist: Environment setup checklist

Loading practice…

verify_setup.sql
sql
-- Verify all 9 tables are loaded
SELECT
  'customers' AS table_name, COUNT(*) AS row_count FROM customers
UNION ALL SELECT 'orders', COUNT(*) FROM orders
UNION ALL SELECT 'order_items', COUNT(*) FROM order_items
UNION ALL SELECT 'order_payments', COUNT(*) FROM order_payments
UNION ALL SELECT 'order_reviews', COUNT(*) FROM order_reviews
UNION ALL SELECT 'products', COUNT(*) FROM products
UNION ALL SELECT 'sellers', COUNT(*) FROM sellers
UNION ALL SELECT 'geolocation', COUNT(*) FROM geolocation
UNION ALL SELECT 'product_category_translation', COUNT(*) FROM product_category_translation;

Run this query to verify all tables are loaded. You should see row counts for all 9 tables.

If you see row counts for all 9 tables, your database is ready. You have roughly 99k customers, 99k orders, 112k order items, 103k payments, 99k reviews, 32k products, 3k sellers, 1M geolocation entries, and 71 category translations. This is your playground for the entire course. Let's write your first query!