Query across a Google Sheet and a CSV file

Introduction

When working with data it's likely that you will have the need to query across a couple of different sources. In this example, we will show you how to do this with a Google Sheet and a CSV file.
1
SELECT d.Symbol, c.Security, c.Executive, d.Price FROM (SELECT a.Symbol as Symbol, a.Security as Security, b.Executive as Executive
2
FROM "https://raw.githubusercontent.com/dylanroy/sandp500-dataset/main/data.csv" a
3
JOIN "https://raw.githubusercontent.com/dylanroy/ceo-dataset/main/data.csv" b ON a.Security = b.Company) c
4
JOIN "https://docs.google.com/spreadsheets/d/1u0RkdS8KBwvCvSSIiS-xCN-P1RAfhgNRVewysHGIOrg" d ON c.Symbol = d.Symbol
Copied!
A sample Query using public example datasets that can be tested in the demo interface here or the OpenAPI documentation here.
To See a more complex example with a more simple query please see the tutorial linked below.
Last modified 8mo ago
Copy link