The goal is to gamify SQL/Data proficiency by placing the user in a Noir mystery where the only way to catch the killer is to join tables and filter data. We will build this as a standalone Coda doc.
User Review Required
[!NOTE] Mechanics Choice: Coda does not support raw SQL execution. The "puzzles" will be solved by the user writing Coda Formulas (e.g., Suspects.Filter(CarColor="Blue")) or using Table Filters, which teaches the same boolean logic and relational thinking as SQL.
Narrative Hook
The Crime: A rare algorithm has been stolen from "Silicon Valley Bank... of Code". The Clue: A witness saw the thief leave the server room at 10:42 PM on Jan 14th, get into a Red Convertible, and drive toward the Gym.
Proposed Changes
Database Schema (The Evidence)
We will create 3 Relational Tables:
Citizens (The central table) Owner_ID (Lookup -> Citizens) Location (Text - e.g., "Server Room", "Gym", "Coffee Shop") Badge_ID (Number - maps to Citizen ID) Gameplay UI (The Pages)
Introduction text setting the scene. The "Police Report" (The first clue). Read-only views of the 3 tables. Instructions on how to "Filter" or "Query". Control: A text input or select list for "Accuse Suspect". Feedback: A formula that checks if the accused matches the perpetrator logic. Logic: Access_Logs(Server Room, 10:42) -> ID AND Vehicle(Red Convertible) -> ID. Execution Steps
Create Doc "Data Detective". Create and Populate Tables (using mcp_Coda_table_create). Generate ~20 "Red Herrings" (random people). Generate 1 "Perp" (Matches all clues). Generate 2 "Partial Matches" (Matches car but not time, etc.) to make it tricky. Set up the "Detective's Desk" UI with unlocking feedback. Verification Plan
Manual Playthrough: usage of the Coda doc to "solve" the crime myself using the clues. Logic Check: Verify that ONLY ONE row satisfies (Time=10:42) AND (Car=Red Convertible).