
Before you begin
- Labs create a Google Cloud project and resources for a fixed time
- Labs have a time limit and no pause feature. If you end the lab, you'll have to restart from the beginning.
- On the top left of your screen, click Start lab to begin
Query a public dataset (dataset: samples, table: natality)
/ 15
Create a new dataset
/ 30
Load data into your table
/ 40
Query a custom dataset
/ 15
Storing and querying massive datasets can be time consuming and expensive without the right hardware and infrastructure. BigQuery is an enterprise data warehouse that solves this problem by enabling super-fast SQL queries using the processing power of Google's infrastructure. Simply move your data into BigQuery and let us handle the hard work. You can control access to both the project and your data based on your business needs, such as giving others the ability to view or query your data.
You can access BigQuery in the Console, the command-line tool, or by making calls to the BigQuery REST API using a variety of client libraries such as Java, .NET, or Python. There are also a variety of third-party tools that you can use to interact with BigQuery, such as visualizing the data or loading the data.
This hands-on lab shows you how to query public tables and load sample data into BigQuery.
Read these instructions. Labs are timed and you cannot pause them. The timer, which starts when you click Start Lab, shows how long Google Cloud resources are made available to you.
This hands-on lab lets you do the lab activities in a real cloud environment, not in a simulation or demo environment. It does so by giving you new, temporary credentials you use to sign in and access Google Cloud for the duration of the lab.
To complete this lab, you need:
Click the Start Lab button. If you need to pay for the lab, a dialog opens for you to select your payment method. On the left is the Lab Details pane with the following:
Click Open Google Cloud console (or right-click and select Open Link in Incognito Window if you are running the Chrome browser).
The lab spins up resources, and then opens another tab that shows the Sign in page.
Tip: Arrange the tabs in separate windows, side-by-side.
If necessary, copy the Username below and paste it into the Sign in dialog.
You can also find the Username in the Lab Details pane.
Click Next.
Copy the Password below and paste it into the Welcome dialog.
You can also find the Password in the Lab Details pane.
Click Next.
Click through the subsequent pages:
After a few moments, the Google Cloud console opens in this tab.
Cloud Shell is a virtual machine that is loaded with development tools. It offers a persistent 5GB home directory and runs on the Google Cloud. Cloud Shell provides command-line access to your Google Cloud resources.
Click Activate Cloud Shell at the top of the Google Cloud console.
Click through the following windows:
When you are connected, you are already authenticated, and the project is set to your Project_ID,
gcloud
is the command-line tool for Google Cloud. It comes pre-installed on Cloud Shell and supports tab-completion.
Output:
Output:
gcloud
, in Google Cloud, refer to the gcloud CLI overview guide.
The BigQuery console provides an interface to query tables, including public datasets offered by BigQuery. The query you will run accesses a table from a public dataset that BigQuery provides. It uses standard query language to search the dataset, and limits the results returned to 10.
The Welcome to BigQuery in the Cloud Console message box opens. This message box provides a link to the quickstart guide and the release notes.
The BigQuery console opens.
This data sample holds information about US natality (birth rates).
A green or red check displays depending on whether the query is valid or invalid. If the query is valid, the validator also describes the amount of data to be processed after you run the query.
This information helps determine the cost to run a query.
Your query results should resemble the following:
Test completed task
Click Check my progress to verify your performed task. If you have successfully queried against the public dataset, you'll see an assessment score.
To load custom data into a table, you first need to create a BigQuery dataset.
Datasets help control access to tables and views in a project. This lab uses only one table, but you still need a dataset to hold the table.
Set Dataset ID to babynames.
Leave all other fields at their default settings. Click Create dataset.
Now you have a dataset.
Test completed task
Click Check my progress to verify your performed task. If you have successfully created the BigQuery dataset, you'll see an assessment score.
Next you create a table inside the babynames dataset, then load the data file from your storage bucket into the new table.
The custom data file you'll use contains approximately 7 MB of data about popular baby names, provided by the US Social Security Administration.
In the Cloud Console, select Navigation menu > BigQuery to return to the BigQuery console.
Navigate to the babynames dataset, by clicking View actions () near your dataset then click Create table.
In the Create table dialog, set the following fields, leave all others at the default value:
Field | Value |
---|---|
Create table from | Google Cloud Storage |
Select file from GCS bucket | spls/gsp072/baby-names/yob2014.txt |
File format | CSV |
Table | names_2014 |
Schema > Edit as text | Slide on, then add the following in the textbox: name:string,gender:string,count:integer
|
When BigQuery is finished creating the table and loading the data, you see the names_2014
table under the babynames
dataset.
Test completed task
Click Check my progress to verify your performed task. If you have successfully loaded data into the dataset table, you'll see an assessment score.
Check your table! View the first few rows of the data.
names_2014
table in the left panel, then click Preview.Your table is ready for queries.
Running a query against custom data is identical to the querying a public dataset that you did earlier, except that now you're querying your own table instead of a public table.
In BigQuery, click the + (Compose new query) icon at the top.
Paste or type the following query into the query Editor.
Test completed task
Click Check my progress to verify your performed task. If you have successfully queried against the custom dataset, you'll see an assessment score.
Below is a true/false question to reinforce your understanding of this lab's concepts. Answer it to the best of your abilities.
You used BigQuery to query public tables and load sample data into BigQuery.
This lab is part of a series of labs called Qwik Starts. These labs are designed to give you a little taste of the many features available with Google Cloud. Search for "Qwik Starts" in the lab catalog to find the next lab you'd like to take!
...helps you make the most of Google Cloud technologies. Our classes include technical skills and best practices to help you get up to speed quickly and continue your learning journey. We offer fundamental to advanced level training, with on-demand, live, and virtual options to suit your busy schedule. Certifications help you validate and prove your skill and expertise in Google Cloud technologies.
Manual Last Updated April 19, 2024
Lab Last Tested April 19, 2024
Copyright 2025 Google LLC All rights reserved. Google and the Google logo are trademarks of Google LLC. All other company and product names may be trademarks of the respective companies with which they are associated.
This content is not currently available
We will notify you via email when it becomes available
Great!
We will contact you via email if it becomes available
One lab at a time
Confirm to end all existing labs and start this one