Create new SQL download
About SQL downloads
SQL downloads allow users to query GBIF occurrence data using Structured Query Language (SQL). This enables the selection of specific columns of interest and generation of summary views without having to download full occurrence datasets. The SQL query interface is used for the generation of species occurrences cubes.
Example of SQL download query
The below example returns a csv containing the number of European occurrence records grouped by dataset and country:
SELECT datasetKey, countryCode, COUNT(*) FROM occurrence WHERE continent = 'EUROPE' GROUP BY datasetKey, countryCode
Output:
| datasetKey | countryCode | COUNT(*) |
|---|---|---|
| 005eb8d8-ed94-41be-89cf-e3115a9058e4 | AD | 1 |
| 009a76f6-0960-4a56-a116-63991e6bb037 | GR | 3 |
| 0214a6a7-898f-4ee8-b888-0be60ecde81f | PT | 84 |
| 03f2256a-e548-43d7-a731-253302f4aa34 | LV | 27 |
| 040c5662-da76-4782-a48e-cdea1892d14c | IS | 1306 |
| … | … | … |
Please refer to the SQL downloads documentation for full details of syntax and functions.