Skip to content
// Keep Starlight's per-page banner (if any) + add our legal banner

SQL Mini-Case 0a

Loading…
Read-only demo: /data/cozymerc_deals.db
  • 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.

  1. Pick a query from the dropdown.
  2. Run it: click Run or press Ctrl/⌘ + Enter.
  3. Filter rows with the Filter box.
  4. Edit SQL in the big text area and hit Run again.
  5. Download CSV to save the current table.
  6. 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_amount or amount shows ~5000

The Filter is a simple case-insensitive contains match across all visible columns (no >, <, or AND/OR).

Loading…
Read-only demo: /data/cozymerc_deals.db

Paste these into the editor if you want to tweak by hand.

-- Top reps by closed deals & average days to close
SELECT r.name AS rep,
COUNT(*) AS deals,
ROUND(AVG(days_to_close),1) AS avg_days_to_close
FROM v_won_lost wl
JOIN reps r ON r.id = wl.rep_id
GROUP BY r.name
ORDER BY deals DESC, avg_days_to_close ASC;