Skip to content

Table schemas

Table schemas define the tables and columns available to query in a dataset definition. The schema a dataset definition is written against determines which backends it can be run inside.

Below are a list of all table schemas available in ehrQL, together with the backends that support them.


view details →

Available on backends: TPP

This defines all the data (both primary care and externally linked) available in the OpenSAFELY-TPP backend. For more information about this backend, see the SystmOne Primary Care section.


view details →

Available on backends: TPP, EMIS

This schema defines the core tables and columns which should be available in any backend providing primary care data, allowing dataset definitions written using this schema to run across multiple backends.


This schema is still a work-in-progress while the EMIS backend remains under development. Projects requiring EMIS data should continue to use the Cohort Extractor tool.


view details →

Available on backends: TPP, EMIS

This tiny schema is used to write a minimal dataset definition that can function as a basic end-to-end test (or "smoke test") of the OpenSAFELY platform across all available backends.


view details →

This schema is for development or testing purposes and is not available on any backend.

This example schema is for use in the ehrQL tutorial.