Intro to SQLfor Organizing
Subsection 6.4

Save and share

~5 min

Reading

A query becomes more useful when someone else can find it, rerun it, or understand it.

BigQuery includes several sharing and output options.

Ways to share queried data

  • Local file exports: CSV or JSON.
  • Online locations: CSV in Google Drive or a static Google Sheet.
  • BI and analysis tools: Looker Studio or Colab notebooks.

Use CSV when the recipient needs a simple data snapshot. CSV files open in most spreadsheet tools.

Use JSON when the data structure is more complex or may be read by another system.

Use Google Sheets when stakeholders need to view or lightly analyze the result in a browser.

Use Looker Studio when you want a dashboard or visual report.

Use Colab when you want to share both data and analysis code.

BigQuery also has buttons near the query editor:

  • Run: runs the query.
  • Save: creates a saved query or query snippet.
  • Share: manages access.
  • Schedule: runs a query later or on a regular interval.
  • More: can specify a table where query output should be saved.

BigQuery does not automatically save every query you type as a saved query. Query History may keep executed queries for a period of time, but that is not the same as saving an important query for long-term use.

Best practice

  • Save important queries as snippets or saved queries.
  • Give the query a clear name.
  • Include comments if the logic needs explanation.
  • Confirm sharing permissions before sending a link.
  • For complex work, store SQL in version control or a shared documentation space.

Scheduled queries are useful for regular reporting. For example, a GOTV program might run a nightly query that counts doors knocked, supporter responses, areas covered, and follow-up needs. The output could feed a dashboard for campaign managers.

Learner action

Save or prepare to share your final query. Write down where the query will live and who needs access.

Saving the query (deck slide 29)

From the deck speaker note:

"BigQuery does not automatically save every query you write. To retain a query, click the Save button in the SQL editor. You can save it as a query snippet for later use."

Two layers to remember:

  • Saved Queries : manual saves you (or your team) can return to later.
  • Query history : BigQuery automatically logs every query you've run for 90 days.

Save your query : six steps

  1. Click Save above the query editor.
  2. Choose Save query.
  3. Give it a clear name: "Intro to SQL : [your case]".
  4. Add a one-line description so a teammate can read the purpose without running it.
  5. Pick Personal (private to you) or Project (shared with anyone who has project access).
  6. Copy the SQL into your Organizer Query Brief.

Sharing the result (deck slide 28)

How to shareWhen to use it
Download CSVStakeholders who want a snapshot to open in Excel or Sheets.
Download JSONNested data, or feeding another tool.
Save to Google Drive (CSV)Large datasets, easier link-sharing.
Save to Google SheetsLightweight collaborative review with built-in permissions.
Save to a BigQuery table (More menu)Persist the output as its own table for downstream queries.
Looker StudioLive dashboard for ongoing reporting.
Colab notebookPair the data with Python analysis.

Bonus : the Schedule button (deck slide 29: Rosario's GOTV case)

If your team relies on the same report every two weeks (door-knock summaries, signups by zip, missing-phone reports), BigQuery's Schedule button can re-run your query nightly, weekly, or on any cron schedule, and write the output to a table or dashboard. From Rosario's deck: "Schedule the query to run automatically every night, summarizing the day's door-knocking efforts. The output is directed to a dashboard accessible to campaign managers, who can identify strong and weak areas, adjust strategies, and plan for the following days." You won't enable a schedule today, but knowing it exists turns one good query into ongoing infrastructure.

Action: Save your query in BigQuery with a clear name and one-line description. Copy the SQL into your brief.