Core SQL Engineer — hero flash

Five scenes cycle automatically. Dots to jump, or open ?scene=0..4. Self-contained, no external assets.

Core SQL Engineer
YOU ASK
👤
Operations Managerdoes not write SQL
Core SQL Engine 14 tables readjoin pathvalidated
YOU GETExecutable T-SQL
WITH q AS ( SELECT provider_id, DATETRUNC(quarter, service_date) AS qtr, SUM(billed_amount) AS billed FROM dbo.claims -- 1.4B rows, partitioned WHERE service_date >= DATEADD(quarter,-5,SYSUTCDATETIME()) GROUP BY provider_id, DATETRUNC(quarter, service_date)), g AS ( SELECT *, LAG(billed) OVER (PARTITION BY provider_id ORDER BY qtr) AS prev FROM q)SELECT p.provider_name, g.qtr, g.billed, CAST((g.billed-g.prev)*100.0/NULLIF(g.prev,0) AS decimal(6,2)) AS growth_pctFROM g JOIN dbo.providers p ON p.provider_id = g.provider_idWHERE (g.billed-g.prev)/NULLIF(g.prev,0) > 0.20 ORDER BY growth_pct DESC;
YOU SNAP
📸
A photo of a report on screenno export, no source query
Core SQL Engine grid parsedfilters inferredschema matched
YOU GETReconstructed query
-- assisted reconstruction from the imageSELECT d.dept_name, SUM(CASE WHEN c.claim_status='PENDING' THEN c.paid_amount END) AS pending, SUM(CASE WHEN c.claim_status='DENIED' THEN c.paid_amount END) AS denied, SUM(CASE WHEN c.claim_status='APPROVED' THEN c.paid_amount END) AS approvedFROM dbo.claims c JOIN dbo.departments d ON d.dept_id=c.dept_idWHERE c.service_date >= '2026-04-01' -- partition eliminationGROUP BY d.dept_name HAVING SUM(c.paid_amount) > 250000;
YOU ASK
🛠️
"This report times out since we grew."1.4B rows · 214 GB · +40M/month
Plan analysis
Clustered Index Scan · 1.4B rows Sort · 3.2 GB tempdb spill Hash Match · residual
DMV suggestion verified, not applied blindlywrite cost weighed
YOU GETPartitioning + covering index
CREATE PARTITION FUNCTION pf_claims_m (date) AS RANGE RIGHT FOR VALUES ('2026-05-01','2026-06-01','2026-07-01');CREATE PARTITION SCHEME ps_claims_m AS PARTITION pf_claims_m ALL TO ([FG_CLAIMS]);CREATE NONCLUSTERED INDEX IX_claims_status_service ON dbo.claims (claim_status, service_date DESC) INCLUDE (provider_id, paid_amount) WITH (DATA_COMPRESSION=PAGE, ONLINE=ON) ON ps_claims_m (service_date);
Before
71,400 ms
After
240 ms
YOU ASK
🚨
"Everything is frozen."2:14 a.m. · production
Blocking chain
SPID 84 · head 112 219 · deadlock victim 340
open txn 04:12LCK_M_X on dbo.claimsimplicit_transactions ON
YOU GETRoot cause + diagnostic
-- uncommitted txn from the app pool is holding X locksWITH blocked AS ( SELECT r.session_id, r.blocking_session_id, r.wait_type, r.wait_time, OBJECT_NAME(p.object_id) AS locked_object FROM sys.dm_exec_requests r JOIN sys.dm_tran_locks l ON l.request_session_id = r.session_id JOIN sys.partitions p ON p.hobt_id = l.resource_associated_entity_id WHERE r.blocking_session_id <> 0)SELECT * FROM blocked ORDER BY wait_time DESC;
YOU ASK
🛡️
Safe by constructionevery statement validated before it runs
Requested
DELETE FROM dbo.claims WHERE service_date < '2020-01-01';
parsedrisk classifiedimpact estimatedblocked
YOU GETRefusal + safer path
-- 412M rows · log growth ~180 GB · blocking risk on 6 partitions-- read-only mode: destructive statement requires approval-- suggested instead: partition switch, minimally loggedALTER TABLE dbo.claims SWITCH PARTITION 3 TO dbo.claims_archive PARTITION 3;
audited · user · time · database
Natural language → SQL ● generated

Adding more jam: add a <div class="scene"> plus one SCENES entry (title, state, three metrics, optional onEnter). Same shell as the Scientific Image Analysis flash, so both merge into one player later.