SQL Queries

The BETYdb repository has a large number of example SQL queries if you search for the terms 'select' and 'join' in its issuesarrow-up-right.

SQL is the most flexible way of querying data from BETYdb. The full list of tablesarrow-up-right and schemaarrow-up-right on the website is up to date with the current database, but the tables below are stable.

These are the core tables required to query traits and yields:

We have created 'views' to make it easier to query data from multiple tables. For example, to lookup the name and location of a site or the names and units of variables. The following query joins multiple tables, and is based on the yieldsview table:

Last updated