Self-service / SQL
Write SQL against the gold tables every dashboard reads. The engine is DuckDB compiled to WebAssembly: it runs in your browser, on your own copy of the synthetic warehouse, so a query never reaches a server. The database is read-only, file and network access are switched off, and a query that runs too long is stopped. Start from a worked example or from the SQL behind any governed metric, in DuckDB, PostgreSQL and T-SQL, and read each table's contract in the schema browser before you use a column. To explore without SQL, use the metric explorer.
Synthetic data for demonstration. Every study, site, subject and vendor is fictional. Designed to these controls. Not a validated system and not a compliance claim.
The engine is DuckDB compiled to WebAssembly. It downloads once (about 7 MB compressed), runs in its own worker in this tab, and holds your own copy of the gold tables. Nothing you type leaves the browser, and the database refuses files, the network and every change.
Every query not closed at the data cut, with its age in days, its rank by age within its study, the number open in the study and its site's median age. Closed studies are left out, as the certified open-query metrics leave them out.
Shows: window functions, star-schema joins. Reads: gold.fct_query, gold.dim_study, gold.dim_site, gold.dim_date.
Start the engine to run queries. You can read and edit the SQL now.
Rows appear here once the engine is running.
The gold layer the engine loads: every table and column with the description, owner and classification its data contract records.
Conformed study dimension.
| Column | Type and meaning |
|---|---|
| study_key | integer, not null Ā· internalSurrogate key. |
| study_id | string, not null Ā· internalProtocol id, the natural key. |
| study_title | string, not null Ā· internalShort title. |
| therapeutic_area | string, not null Ā· internalTherapeutic area. |
| product_type | string, not null Ā· internalInvestigational product type. |
| phase | string, not null Ā· internalDevelopment phase or device study stage. |
| regulatory_path | string, not null Ā· internalIND or IDE. |
| operating_model | string, not null Ā· internalSponsor or CRO. |
| cro_vendor_id | string Ā· internalVendor id of the CRO. |
| study_status | string, not null Ā· internalLifecycle status at the data cut. |
| start_on | date, not null Ā· internalDate the protocol was finalised. |
| planned_enrollment | integer, not null Ā· internalEnrollment target. |
| is_randomized | boolean, not null Ā· internalWhether subjects are randomised. |
| arm_count | integer, not null Ā· internalNumber of treatment arms. |
| has_cec_adjudication | boolean, not null Ā· internalWhether a clinical events committee adjudicates events. |
| study_data_product_id | string Ā· internalStudy Data Pipeline product id. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Conformed site dimension, slowly changing type 2 on site status and principal investigator.
| Column | Type and meaning |
|---|---|
| site_key | integer, not null Ā· internalSurrogate key of the version. |
| site_id | string, not null Ā· internalSite id, the natural key. |
| version_number | integer, not null Ā· internalVersion of the site, from 1. |
| study_id | string, not null Ā· internalProtocol id. |
| site_number | string, not null Ā· internalSite number within the study. |
| site_name | string, not null Ā· internalFictional site name. |
| country_code | string, not null Ā· internalISO 3166-1 alpha-2 country code. |
| planned_enrollment | integer, not null Ā· internalEnrollment target for the site. |
| selected_on | date Ā· internalDate the site was selected (start-up stage 1). |
| contracted_on | date Ā· internalDate the clinical trial agreement was executed (stage 2). |
| irb_approved_on | date Ā· internalDate the IRB or ethics committee approved the study at the site (stage 3). |
| initiated_on | date Ā· internalDate of the site initiation visit (stage 4). |
| activated_on | date Ā· internalActivation date (stage 5). |
| first_subject_in_on | date Ā· internalDate the site enrolled its first subject (stage 6). |
| site_status | string, not null Ā· internalStatus during the version: start-up, active or closed. |
| principal_investigator_id | string Ā· confidentialFictional id of the principal investigator during the version, or null when none is on file. |
| valid_from | date, not null Ā· internalFirst day the version is in force (inclusive). |
| valid_to | date, not null Ā· internalDay the next version takes over (exclusive), or 9999-12-31. |
| is_current | boolean, not null Ā· internalWhether this is the latest version. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Conformed country dimension.
| Column | Type and meaning |
|---|---|
| country_key | integer, not null Ā· publicSurrogate key. |
| country_code | string, not null Ā· publicISO 3166-1 alpha-2 country code. |
| country_name | string, not null Ā· publicEnglish short name. |
| region | string, not null Ā· publicOperational region. |
Conformed calendar dimension, whole years around every fact date.
| Column | Type and meaning |
|---|---|
| date_key | integer, not null Ā· publicSmart key, YYYYMMDD. |
| calendar_date | date, not null Ā· publicThe day. |
| year_number | integer, not null Ā· publicCalendar year. |
| quarter_number | integer, not null Ā· publicCalendar quarter, 1 to 4. |
| month_number | integer, not null Ā· publicCalendar month, 1 to 12. |
| month_name | string, not null Ā· publicEnglish month name. |
| day_of_month | integer, not null Ā· publicDay of the month. |
| iso_day_of_week | integer, not null Ā· publicISO 8601 day of the week, Monday 1 to Sunday 7. |
| year_month | string, not null Ā· publicYear and month, for example 2026-09. |
| year_quarter | string, not null Ā· publicYear and quarter, for example 2026-Q3. |
| is_month_end | boolean, not null Ā· publicWhether the day is the last of its month. |
Conformed vendor dimension, with key 0 for spend that has no vendor (investigator grants).
| Column | Type and meaning |
|---|---|
| vendor_key | integer, not null Ā· internalSurrogate key; 0 is the not-applicable member. |
| vendor_id | string, not null Ā· internalVendor id, or N/A. |
| vendor_name | string, not null Ā· internalFictional vendor name. |
| vendor_service | string, not null Ā· internalService the vendor provides. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Conformed milestone dimension: the milestone kinds in lifecycle order.
| Column | Type and meaning |
|---|---|
| milestone_key | integer, not null Ā· publicSurrogate key. |
| milestone_kind | string, not null Ā· publicMilestone kind. |
| milestone_name | string, not null Ā· publicNeutral display name. |
| milestone_sequence | integer, not null Ā· publicPosition in the study lifecycle, from 1. |
Monitoring plan dimension: the cadence and report deadline each study's plan sets, which monitoring is measured against.
| Column | Type and meaning |
|---|---|
| monitoring_plan_key | integer, not null Ā· internalSurrogate key. |
| monitoring_plan_id | string, not null Ā· internalMonitoring plan id. |
| study_id | string, not null Ā· internalProtocol id. |
| plan_version | string, not null Ā· internalPlan version. |
| effective_date_key | integer, not null Ā· internalDate the plan took effect. |
| interim_interval_days | integer, not null Ā· internalPlanned days from one monitoring visit at a site to the next interim visit. |
| visit_window_days | integer, not null Ā· internalDays an interim visit may fall after its planned date and still be on time. |
| report_due_days | integer, not null Ā· internalDays from a visit by which its report must be final. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Subject enrollment events: screened, enrolled, completed and discontinued.
| Column | Type and meaning |
|---|---|
| subject_id | string, not null Ā· confidentialSubject id (degenerate dimension). |
| event_type | string, not null Ā· internalscreened, enrolled, completed or discontinued. |
| study_key | integer, not null Ā· internalStudy. |
| site_key | integer, not null Ā· internalSite version in force on the event date. |
| country_key | integer, not null Ā· internalCountry of the site. |
| event_date_key | integer, not null Ā· internalDate of the event. |
| subject_status | string, not null Ā· internalSubject status at the data cut. |
| screen_failure_reason | string Ā· internalWhy screening failed; null unless the subject failed screening (degenerate dimension). |
| event_count | integer, not null Ā· internalAlways 1: the additive measure. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Subject visits against the schedule, with entry timeliness.
| Column | Type and meaning |
|---|---|
| visit_id | string, not null Ā· confidentialVisit record id (degenerate dimension). |
| subject_id | string, not null Ā· confidentialSubject id (degenerate dimension). |
| planned_visit_id | string, not null Ā· internalPlanned visit id. |
| study_key | integer, not null Ā· internalStudy. |
| site_key | integer, not null Ā· internalSite version in force on the visit date, or the planned date of a missed visit. |
| country_key | integer, not null Ā· internalCountry of the site. |
| visit_date_key | integer Ā· internalVisit date, or null for a missed visit. |
| planned_date_key | integer, not null Ā· internalPlanned date: enrollment plus the planned day. |
| visit_status | string, not null Ā· internalentered, pending-entry or missed. |
| day_offset | integer Ā· internalActual minus planned day. |
| is_out_of_window | boolean, not null Ā· internalWhether the visit fell outside its window. |
| entry_lag_days | integer Ā· internalDays from the visit to data entry. |
| entry_hour | integer Ā· internalHour of the day, 0 to 23 in UTC, the visit's data was entered. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Data queries with their resolution times.
| Column | Type and meaning |
|---|---|
| query_id | string, not null Ā· internalQuery id (degenerate dimension). |
| visit_id | string, not null Ā· confidentialVisit record id (degenerate dimension). |
| subject_id | string, not null Ā· confidentialSubject id (degenerate dimension). |
| study_key | integer, not null Ā· internalStudy. |
| site_key | integer, not null Ā· internalSite version in force when the query opened. |
| country_key | integer, not null Ā· internalCountry of the site. |
| opened_date_key | integer, not null Ā· internalUTC date the query opened. |
| answered_date_key | integer Ā· internalUTC date the site answered. |
| closed_date_key | integer Ā· internalUTC date the query closed. |
| queried_field | string, not null Ā· internalQueried field, as DOMAIN.VARIABLE. |
| queried_form | string, not null Ā· internalCRF form of the queried field: its CDASH domain, the part of queried_field before the dot. |
| query_origin | string, not null Ā· internaledit-check or manual. |
| query_status | string, not null Ā· internalState at the data cut. |
| minutes_to_answer | integer Ā· internalMinutes from opening to the site's answer. |
| minutes_to_close | integer Ā· internalMinutes from opening to closing. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Protocol deviations with their time to identification.
| Column | Type and meaning |
|---|---|
| deviation_id | string, not null Ā· internalDeviation id (degenerate dimension). |
| subject_id | string, not null Ā· confidentialSubject id (degenerate dimension). |
| study_key | integer, not null Ā· internalStudy. |
| site_key | integer, not null Ā· internalSite version in force when the deviation occurred. |
| country_key | integer, not null Ā· internalCountry of the site. |
| occurred_date_key | integer, not null Ā· internalDate the deviation occurred. |
| identified_date_key | integer, not null Ā· internalDate the deviation was identified. |
| deviation_category | string, not null Ā· internalDeviation category. |
| importance | string, not null Ā· internalimportant or not-important. |
| is_important | boolean, not null Ā· internalWhether the deviation is important per ICH E3. |
| days_to_identify | integer, not null Ā· internalDays from occurrence to identification. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Events sent to the clinical events committee, with when each was reported and adjudicated (#2881).
| Column | Type and meaning |
|---|---|
| event_id | string, not null Ā· internalEvent id (degenerate dimension). |
| subject_id | string, not null Ā· confidentialSubject id (degenerate dimension). |
| study_key | integer, not null Ā· internalStudy. |
| site_key | integer, not null Ā· internalSite version in force when the event was reported. |
| country_key | integer, not null Ā· internalCountry of the site. |
| occurred_date_key | integer, not null Ā· internalDate the event occurred. |
| reported_date_key | integer, not null Ā· internalDate the site reported the event. |
| adjudicated_date_key | integer Ā· internalDate the committee adjudicated the event, or null while it waits. |
| days_to_adjudicate | integer Ā· internalDays from the site's report to adjudication. |
| site_device_related | boolean, not null Ā· internalWhether the site judged the event device-related. |
| cec_device_related | boolean Ā· internalWhether the committee judged the event device-related. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Adverse events with their onset, report and seriousness, for safety reporting and central monitoring (#2956).
| Column | Type and meaning |
|---|---|
| ae_id | string, not null Ā· internalAdverse event id (degenerate dimension). |
| visit_id | string, not null Ā· confidentialVisit record id the event was reported at (degenerate dimension). |
| subject_id | string, not null Ā· confidentialSubject id (degenerate dimension). |
| study_key | integer, not null Ā· internalStudy. |
| site_key | integer, not null Ā· internalSite version in force when the site reported the event. |
| country_key | integer, not null Ā· internalCountry of the site. |
| onset_date_key | integer, not null Ā· internalDate the event began. |
| reported_date_key | integer, not null Ā· internalDate the site reported the event. |
| days_to_report | integer, not null Ā· internalDays from onset to the site's report. |
| ae_term | string, not null Ā· confidentialReported term. |
| is_serious | boolean, not null Ā· internalWhether the event is serious (ICH E2A). |
| severity | string, not null Ā· internalSeverity: mild, moderate or severe. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Vital signs by visit, one column per sign, for central monitoring of how sites record them (#2957).
| Column | Type and meaning |
|---|---|
| visit_id | string, not null Ā· confidentialVisit record id the signs were taken at (degenerate dimension). |
| subject_id | string, not null Ā· confidentialSubject id (degenerate dimension). |
| study_key | integer, not null Ā· internalStudy. |
| site_key | integer, not null Ā· internalSite version in force on the day of the visit. |
| country_key | integer, not null Ā· internalCountry of the site. |
| measured_date_key | integer, not null Ā· internalDate the signs were taken. |
| systolic_bp_mmhg | integer Ā· confidentialSystolic blood pressure (VSTESTCD SYSBP), in mmHg; null when not recorded. |
| diastolic_bp_mmhg | integer Ā· confidentialDiastolic blood pressure (VSTESTCD DIABP), in mmHg; null when not recorded. |
| pulse_bpm | integer Ā· confidentialPulse rate (VSTESTCD PULSE), in beats/min; null when not recorded. |
| weight_kg | decimal Ā· confidentialWeight (VSTESTCD WEIGHT), in kg; null when not recorded. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Monitoring visits with source data verification and report timeliness.
| Column | Type and meaning |
|---|---|
| monitoring_visit_id | string, not null Ā· internalMonitoring visit id (degenerate dimension). |
| study_key | integer, not null Ā· internalStudy. |
| site_key | integer, not null Ā· internalSite version in force on the visit date. |
| country_key | integer, not null Ā· internalCountry of the site. |
| visit_date_key | integer, not null Ā· internalVisit date. |
| report_final_date_key | integer Ā· internalDate the report was finalised. |
| monitoring_plan_key | integer, not null Ā· internalMonitoring plan in force on the visit date. |
| report_due_date_key | integer, not null Ā· internalDate the report is due: the visit date plus the plan's report deadline. |
| visit_type | string, not null Ā· internalSIV, IMV or COV. |
| visit_mode | string, not null Ā· internalOn-site or remote. |
| sdv_pages_due | integer, not null Ā· internalCRF pages due for source data verification. |
| sdv_pages_verified | integer, not null Ā· internalCRF pages source-verified. |
| action_items | integer, not null Ā· internalAction items raised. |
| days_to_final_report | integer Ā· internalDays from the visit to the final report. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Interim monitoring visits the monitoring plan schedules at each active site, each against the visit that met it.
| Column | Type and meaning |
|---|---|
| planned_visit_id | string, not null Ā· internalPlanned visit id (degenerate dimension): the site id and its sequence. |
| monitoring_plan_key | integer, not null Ā· internalMonitoring plan the visit is scheduled under. |
| study_key | integer, not null Ā· internalStudy. |
| site_key | integer, not null Ā· internalSite version in force on the planned date. |
| country_key | integer, not null Ā· internalCountry of the site. |
| planned_date_key | integer, not null Ā· internalPlanned date: the previous monitoring visit at the site plus the plan's interval. |
| due_date_key | integer, not null Ā· internalLast on-time date: the planned date plus the plan's visit window. |
| monitoring_visit_id | string Ā· internalInterim visit that met the planned visit, or null while it is outstanding. |
| actual_date_key | integer Ā· internalDate of the visit that met it, or null while it is outstanding. |
| days_late | integer Ā· internalDays the visit fell after its due date, 0 when on time, or null while it is outstanding. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Study milestones, planned against actual.
| Column | Type and meaning |
|---|---|
| study_key | integer, not null Ā· internalStudy. |
| milestone_key | integer, not null Ā· internalMilestone kind. |
| milestone_label | string, not null Ā· internalLabel in the study's own vocabulary. |
| planned_date_key | integer, not null Ā· internalPlanned date. |
| actual_date_key | integer Ā· internalActual date, or null when not reached. |
| variance_days | integer Ā· internalActual minus planned date, in days. |
| is_reached | boolean, not null Ā· internalWhether the milestone was reached by the data cut. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Budget against actual spend, with each quarter spread evenly over its three months.
| Column | Type and meaning |
|---|---|
| study_key | integer, not null Ā· internalStudy. |
| vendor_key | integer, not null Ā· internalVendor; 0 for investigator grants. |
| month_date_key | integer, not null Ā· internalFirst day of the month. |
| budget_usd | integer, not null Ā· confidentialBudgeted amount, whole US dollars. |
| actual_usd | integer, not null Ā· confidentialActual spend, whole US dollars. |
| variance_usd | integer, not null Ā· confidentialActual minus budget, whole US dollars. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Budget, actual spend and forecast at completion per study and vendor at the data cut. The forecast is the actual spend to date plus the planned budget still to come, scaled by the vendor's spend-to-budget ratio to date.
| Column | Type and meaning |
|---|---|
| study_key | integer, not null Ā· internalStudy. |
| vendor_key | integer, not null Ā· internalVendor; 0 for investigator grants. |
| as_of_date_key | integer, not null Ā· internalThe data cut the forecast was made at. |
| budget_to_date_usd | integer, not null Ā· confidentialBudget for every quarter booked up to the data cut, whole US dollars. |
| actual_to_date_usd | integer, not null Ā· confidentialActual spend for every quarter booked up to the data cut, whole US dollars. |
| remaining_budget_usd | integer, not null Ā· confidentialPlanned budget for the quarters after the data cut, whole US dollars; 0 once the study's final report is in. |
| budget_at_completion_usd | integer, not null Ā· confidentialBudget to date plus the remaining budget, whole US dollars. |
| forecast_at_completion_usd | integer, not null Ā· confidentialActual spend to date plus the remaining budget times actual over budget to date, rounded to whole US dollars; the remaining budget as planned when nothing was budgeted to date. |
| variance_at_completion_usd | integer, not null Ā· confidentialForecast minus budget at completion, whole US dollars; above 0 is a forecast overrun. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |
Month-end key risk indicator snapshots per site, cumulative from activation to the snapshot date.
| Column | Type and meaning |
|---|---|
| site_key | integer, not null Ā· internalSite version in force on the snapshot date. |
| snapshot_date_key | integer, not null Ā· internalMonth-end snapshot date. |
| kri_id | string, not null Ā· internalKey risk indicator: query-rate, missed-visit-rate, important-deviation-rate or entry-lag-days. |
| study_key | integer, not null Ā· internalStudy. |
| country_key | integer, not null Ā· internalCountry of the site. |
| numerator | integer, not null Ā· internalNumerator, cumulative to the snapshot date. |
| denominator | integer, not null Ā· internalDenominator, cumulative to the snapshot date. |
| kri_value | decimal Ā· internalNumerator over denominator, to 4 places; null when the denominator is 0. |
| is_synthetic | boolean, not null Ā· publicAlways true: the row describes synthetic data, nothing real. |