How to run an SQL query from your database to Google Sheets?

Running SQL queries

After you've installed the Castodia add-on and connected your database (e.g. PostgreSQL or MySQL), you can begin running SQL queries onto your Google Sheet.

With the add-on launched, the "Query" tab is the main page where you can input and edit query.

To run an SQL query, follow the steps below:

  1. Input your desired query (e.g. SELECT * FROM countries_daily LIMIT 30)
  2. Click the drop-down menu and decide whether you'd like to overwrite or append the data
  3. Click run and wait for the data to load onto your Google Sheet

Once you've added a direct query into your Google Sheet, a pink line will appear under the sheet name to indicate which sheets have used the add-on. This can help you easily navigate between sheets, especially when managing multiple sheets within the spreadsheet.


Start free trial

Try Castodia free for 14 days, no credit card required.