
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
Construct and run a simple query based on the Cost field
/ 20
List unique services available from the sample bill.
/ 20
Get count of logs generated for each service from the sample bill.
/ 20
Find the GCP project with the most records in the billing data.
/ 20
Find the cost breakdown per project
/ 20
BigQuery is Google's serverless, highly scalable enterprise data warehouse that is designed to make data analysts more productive with unmatched price-performance.
In this lab, you use BigQuery to examine sample Cloud Billing records. After you gain some familiarity with the tool and the dataset, you run SQL queries to gain insights from your billing data.
In this lab, you learn how to do the following:
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.
In this task you locate your billing dataset in the Cloud console. You use BigQuery to look at billing data associated with your project.
In the Google Cloud console, in the Navigation menu (), click BigQuery.
In the Welcome dialog, click Done.
In the Explorer pane, for your project ID, click Expand node ().
The billing_dataset is displayed.
Expand the billing_dataset.
The enterprise_billing dataset is displayed.
In this task you examine the billing data in BigQuery.
In the Google Cloud console, in the Explorer pane, click the enterprise_billing table.
This displays three tabs that provide information on the enterprise_billing table. The Schema tab is open by default. The other tabs are Details and Preview.
BigQuery automatically created this schema based on the sample Cloud Billing records. Notice that there are strings, integers, timestamps, and floating values.
Click the Details tab.
A table with 415,602 rows is displayed.
Click the Preview tab.
Look at the header row of the table to see what information the data provides, and then answer the following questions:
In this task you run SQL queries in BigQuery to analyze your data to obtain information such as, which services were used and what were their associated costs?; which projects incurred the most cost?; and are the costs as expected?
In BigQuery, you use SQL queries to pull and process data from a table to answer your questions. To reference a table in a query, you specify the dataset and table; the project is optional.
In the Google Cloud console, in the Explorer pane, click the enterprise_billing table.
Click + SQL query.
In the Query editor, clear the current query in preparation for the next step.
You enter and run your SQL queries in the Query editor.
In this step you perform some analysis based on costs. You construct a simple query based on the Cost field.
This script queries data in the enterprise_billing
table for records with a Cost
of greater than zero.
Expected output:
Although this shows you how to run a query in BigQuery, the resulting table is not clear or helpful. For a more useful query, run the following script to see how much was spent for services.
In the Query editor, clear the current query.
In the Query editor, type the following, and then click Run:
Notice that you've reduced the number of columns by selecting what information (project.name, service.description, location.country, and cost) you want to see.
Expected output:
Complete the next steps to check your progress to verify an objective and then answer a question using the SQL query output.
Answer this question:
Click Check my progress to verify that you completed the objective.
In the previous step, you queried for specific information, also known as key information, to reduce the amount of data in the table. You used parameters to identify key information. In this section, you'll list key information.
For this example, the number of unique services that are available is the key information you want. Run a query that combines the service description and the SKU description and then lists that as line items.
Click + SQL query.
In the Query editor, clear the current query in preparation for the next step.
In the Query editor, type the following, and then click Run:
Note that GROUP BY 1
means to group the list by the first column.
Expected output:
Answer the following questions:
Click Check my progress to verify that you completed the objective.
In this step you look at service usage to find out the number of times a resource used a service/SKU.
In the Query editor, clear the current query in preparation for the next step.
In the Query editor, type the following, and then click Run:
Expected output:
Answer the following questions:
Click Check my progress to verify that you completed the objective.
In this query you find the Google Cloud project with the most records.
In the Query editor, clear the current query in preparation for the next step.
In the Query editor, type the following, and then click Run:
This query counts how many times a project.id
appears in a record and groups the results by project.id
.
Expected output:
Answer the following question:
Click Check my progress to verify that you completed the objective.
In this step you find the cost breakdown for each project:
In the Query editor, clear the current query in preparation for the next step.
In the Query editor, type the following, and then click Run:
This query adds the cost per project.name and then returns the results grouped by project.name.
Expected output:
Answer the following question:
Click Check my progress to verify that you completed the objective.
In this lab, you explored a sample of Cloud Billing records in BigQuery. After examining the sample dataset and table, you composed and ran queries on the billing data. You then used those queries to answer pertinent billing questions. You are now ready to take more labs in this series.
...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 December 24, 2024
Lab Last Tested December 24, 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