Run your first query
All queries can be run in the query window.
Start small. Run a query that returns a limited number of rows. You are not trying to solve the whole organizing question yet. You are trying to confirm that your table path works and that BigQuery can return results.
A first query may look like this:
SELECT * FROM `prj-training-ao7c.voterfiles.voterfile_snapshot` LIMIT 100;
Then you can modify it:
SELECT voterbase_id, vb_vf_source_state, gender FROM `prj-training-ao7c.voterfiles.voterfile_snapshot` LIMIT 1000;
Ask yourself:
- Did the query run?
- Did the results return rows?
- Do the columns match what I expected from the schema?
- Did
LIMITkeep the result manageable? - Do I need all columns, or only a few?
If you get an error, slow down and read it. Common issues include missing backticks, misspelled table paths, missing commas, or using a column name that does not exist in the schema.
Learner action
Run one working query. Copy it into your Organizer Query Brief as your starter query.
This is the moment. Two queries, hands-on.
Query 1 : Starter
SELECT [column_a], [column_b], [column_c] FROM `project.dataset.table` LIMIT 10;
Replace the columns and table path with your real values. Click Run. Note:
- Rows returned : should be 10.
- Bytes processed : shown above the results panel. Write it down.
Query 2 : DISTINCT sanity check
SELECT DISTINCT [column_name] FROM `project.dataset.table` ORDER BY [column_name];
Pick a column you want to understand better. Run it. How many unique values are there? Is that smaller or larger than you expected?
If you get an error
Read the error message word-for-word. BigQuery error messages name the line and column number where it went wrong. The most common errors at this stage:
- "Syntax error: Unexpected '.'" : your table path needs backticks.
- "Unrecognized name: …" : column name is misspelled or wrong case.
- "Table … not found" : wrong project, dataset, or table name. Or you don't have access.
Try the formatter
Click the format icon above the editor (small icon with two horizontal lines). BigQuery will reflow your SQL : each clause onto its own line. Purely visual but it makes long queries readable. From the deck: "single-line vs multi-line formatting : BQ formatting button."
Don't have access to BigQuery yet? Practice the exact same shape of query right here : it runs in your browser, on a tiny sample voter file. The SQL syntax is identical to what you'd write in BigQuery.
Action: Run both queries. Record rows returned and bytes processed in your brief.