Lab02 - View Sample Billing Data With BigQuery
Lab02 - View Sample Billing Data With BigQuery
Part of working with billing data is working with data exported to BigQuery. In this
lab, we are going to view sample billing exports maintained by Google, and conduct
queries against a public dataset of billing exports. This will be a fun lab in that we
can play around with SQL queries in BigQuery and see what kind of results we can
get. Let's get started!
Once you are in your lab project, we will need to get into the BigQuery web console.
From the top left menu, scroll down to Big Data, and select BigQuery.
Now that we are in BigQuery, let's look at the sample dataset we are going to work
with. We are going to view all columns in our example table to see what fields are
included. From the large Query Editor box, copy and paste the following query, then
click the Run button:
SELECT *
FROM `cloud-training-prod-bucket.arch_infra.billing_data`
SELECT *
FROM `cloud-training-prod-bucket.arch_infra.billing_data`
ORDER BY cost DESC
In this query, we are bringing up the entire table contents, but sorting by the highest
cost first. You can experiment with other fields as well.
Let's now do some specific queries. In the same Query editor box, delete the existing
contents, and enter the below query to find all charges that were more than 3 dollars:
Next let’s find which product had the highest total number of records:
That will conclude this lab. You can quit anytime, however you are also free to
experiment with other query types as well. The great thing about working with
BigQuery is the flexibility of discovering what you can learn from your data!