SQL Mini-Case 0a
What this shows (30s)
Section titled “What this shows (30s)”- Who’s performing? (closed deals & speed to close)
- Are we winning enough? (win rate by rep)
- Where are we stuck? (aging open pipeline)
This runs read-only SQL in your browser against a tiny SQLite file—no server, no secrets.
How to use (60s)
Section titled “How to use (60s)”- Pick a query from the dropdown.
- Run it: click Run or press Ctrl/⌘ + Enter.
- Filter rows with the Filter box.
- Edit SQL in the big text area and hit Run again.
- Download CSV to save the current table.
- Reset DB to reload a fresh, read-only copy.
Notes
- Every visitor gets their own in-memory copy of
/data/cozymerc_deals.db(refresh resets changes). - The dropdown loads from
/data/cozymerc_sql_queries.json(you can add your own).
Quick filter examples (type these in the Filter box)
Section titled “Quick filter examples (type these in the Filter box)”- Ava → rows for rep Ava Chen
- Marcus → rows for rep Marcus Lee
- Enterprise → only Enterprise segment (use with “Pipeline aging” query)
- SMB / Mid-Market → segment filters (Pipeline aging)
- Negotiation → stage filter (Pipeline aging if you add stage to your query)
- 30 → any row containing “30” (e.g.,
avg_days_open≈ 30) - 5000 → rows where
avg_amountoramountshows ~5000
The Filter is a simple case-insensitive contains match across all visible columns (no
>,<, or AND/OR).
Sample queries (copy/paste)
Section titled “Sample queries (copy/paste)”Paste these into the editor if you want to tweak by hand.
-- Top reps by closed deals & average days to closeSELECT r.name AS rep, COUNT(*) AS deals, ROUND(AVG(days_to_close),1) AS avg_days_to_closeFROM v_won_lost wlJOIN reps r ON r.id = wl.rep_idGROUP BY r.nameORDER BY deals DESC, avg_days_to_close ASC;