# 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.

```
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 [here](https://www.usesql.com/demo) or the OpenAPI documentation [here](https://usesql.com/docs).

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

{% content-ref url="/pages/-MWg0KGW9Gt9qhZTIHyh" %}
[Show external query results in a Google Sheet](/tutorials/show-external-query-results-in-a-google-sheet.md)
{% endcontent-ref %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usesql.com/tutorials/query-across-a-google-sheet-and-a-csv-file.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
