UseSQL
  • Introduction
  • Getting Started
    • Source Formats
    • Output Formats
    • Managing Keys
    • Sandbox
    • Saved Queries
  • Client Libraries
    • HTML Templating
    • JavaScript Web Client
  • Tutorials
    • Integrate With Your Static Site
    • Share Data In Slack
    • Show external query results in a Google Sheet
    • Query across a Google Sheet and a CSV file
    • Securing Your Key
    • Querying Airtable
    • Integrate With ProcFu
    • Integrate with a private Google Sheet
    • Updating Google Sheets
    • Retrieving data from tables on a web page
    • Displaying reports in Google Sheets from MySQL
    • Querying StackBy Tables
  • Resources
    • Demo Sandbox
    • OpenAPI Docs
    • Redoc API Docs
    • Roadmap
    • Changelog
Powered by GitBook
On this page

Was this helpful?

  1. Tutorials

Query across a Google Sheet and a CSV file

PreviousShow external query results in a Google SheetNextSecuring Your Key

Last updated 4 years ago

Was this helpful?

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.

SELECT d.Symbol, c.Security, c.Executive, d.Price FROM (SELECT a.Symbol as Symbol, a.Security as Security, b.Executive as Executive
FROM "https://raw.githubusercontent.com/dylanroy/sandp500-dataset/main/data.csv" a 
JOIN "https://raw.githubusercontent.com/dylanroy/ceo-dataset/main/data.csv" b ON a.Security = b.Company) c
JOIN "https://docs.google.com/spreadsheets/d/1u0RkdS8KBwvCvSSIiS-xCN-P1RAfhgNRVewysHGIOrg" d ON c.Symbol = d.Symbol

A sample Query using public example datasets that can be tested in the demo interface or the OpenAPI documentation .

To See a more complex example with a more simple query please see the tutorial linked below.

here
here
Show external query results in a Google Sheet