SQL & Database Design Project
Roast & Rows is a fictional six-location coffee chain, built as a self-contained analytics project to show how I think about relational data — from entity design through to the queries that turn rows into answers. Everything below runs on a real SQLite database, generated fresh in your browser.
01 · Schema
Every table below is created with primary keys, foreign keys, and check
constraints — the same schema running in the live console further down.
order_items is the associative entity that resolves the
many-to-many relationship between orders and menu items, and carries its
own attributes (quantity, price at time of sale).
strong entity
strong entity
strong entity
strong entity
order header
associative / junction entity
weak / dependent entity
02 · Live Console
This loads sql.js (SQLite compiled to WebAssembly) directly in your browser, builds the database from the schema and seed data shown above, and lets you run any of the annotated example queries — or write your own. Nothing leaves your browser; there's no backend.
Loading query library…
03 · Source Files
The same three files that power the console above, meant to be read on their own — useful if you'd rather look at the raw DDL and SQL than click through the UI.
7 CREATE TABLE statements with primary keys, foreign keys, check constraints, and indexes — fully commented.
.sql — DMLThe full mock dataset as INSERT statements — 6 stores, 180 customers, 4,652 orders and more.
.sql — Queries12 annotated queries covering joins, CTEs, window functions, subqueries, and self-joins.