Skip to content

Implementation Plan - Data Detective: The Case of the Silent Query 🕵️‍♀️

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)
Name (Text)
ID (Number)
Address (Text)
License_Plate (Text)
Vehicle_Registry
Plate (Text)
Model (Text)
Color (Text)
Owner_ID (Lookup -> Citizens)
Building_Access_Logs
Location (Text - e.g., "Server Room", "Gym", "Coffee Shop")
Timestamp (Date/Time)
Badge_ID (Number - maps to Citizen ID)

Gameplay UI (The Pages)

Page 1: The Briefing 📁
Introduction text setting the scene.
The "Police Report" (The first clue).
Page 2: The Archives 🗄️
Read-only views of the 3 tables.
Instructions on how to "Filter" or "Query".
Page 3: The Whodunit 🔦
A "Solve" section.
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).
Want to print your doc?
This is not the way.
Try clicking the ··· in the right corner or using a keyboard shortcut (
CtrlP
) instead.