Skip to content

wguDataNinja/retail-transactions-sql-explorer

Repository files navigation

Retail Transactions SQL Explorer

An interviewer-facing SQL surface for the retail transaction case study.

Built with Datasette Lite and SQLite to provide a browser-based, zero-setup environment for live KPI checks, rollups, and ad hoc SQL discussion.

About the data

  • ERP-style retail transaction structure and grain (Kaggle source)
  • 1,000 transaction line items (one row = one product-level line)
  • Source CSV: Sales Data.csv
  • Demo database: retail_transactions_demo.db

What's included

The database includes:

  • transactions - raw imported rows from the CSV
  • working_transactions - working-layer KPI driver columns (month, revenue, flags)
  • KPI views for interview walkthroughs:
    • kpi_checks_summary (Checks)
    • kpi_monthly
    • kpi_channel
    • kpi_status_distribution

The browser interface is read-only.

Live viewer

Open in a browser without setup:

https://wgudataninja.github.io/retail-transactions-sql-explorer/

If you open the local index.html, serve the folder over HTTP first. Datasette Lite cannot load a file:// SQLite URL directly from the browser.

SQL examples

Example queries used for demonstrations are in:

SQL_DEMO.md

Run locally

Use the included CORS-enabled file server:

python3 serve_demo.py

Then open http://127.0.0.1:8000.

Direct Datasette Lite URL pattern:

https://lite.datasette.io/?url=http%3A%2F%2F127.0.0.1%3A8000%2Fretail_transactions_demo.db&metadata=http%3A%2F%2F127.0.0.1%3A8000%2Fmetadata.json&install=datasette-render-html#/retail_transactions_demo

Rebuild the dataset

To rebuild the demo database from Sales Data.csv:

python3 build_demo_db.py

About

This project explores the use of Datasette Lite to allow the exploration of our WGU-Reddit database.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors