Skip to content
EHI Playground

EHI Playground

Welcome to the interactive SQL playground! Here you can write and execute SQL queries against the Epic EHI sample database directly in your browser.

SQL Query Editor

Tips:

  • Press Ctrl+Enter to run your query
  • Your query is automatically saved to the URL - bookmark or share the link!
  • Try loading an example query from the dropdown above
  • The database contains Epic EHI sample data with patient, encounter, and clinical tables

Try these queries to get started:

  1. List all patients:

    SELECT PAT_ID, PAT_NAME, BIRTH_DATE
    FROM PATIENT
    LIMIT 10;
  2. Find recent encounters:

    SELECT p.PAT_NAME, e.CONTACT_DATE, e.ENC_TYPE_TITLE
    FROM PAT_ENC e
    JOIN PATIENT p ON e.PAT_ID = p.PAT_ID
    ORDER BY e.CONTACT_DATE DESC
    LIMIT 20;
  3. View available tables:

    SELECT name
    FROM sqlite_master
    WHERE type='table'
    ORDER BY name;
  • Live Execution - Queries run instantly in your browser using SQL.js
  • URL Sharing - Your queries are saved to the URL for easy sharing
  • Example Library - Load pre-built queries from the manual chapters
  • Keyboard Shortcuts - Press Ctrl+Enter to run queries quickly
  • Export Results - Copy query results to use elsewhere

Happy querying! 🚀