
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
BigQuery is Google's fully managed, NoOps, low cost analytics database. With BigQuery you can query terabytes and terabytes of data without having any infrastructure to manage or needing a database administrator. BigQuery uses SQL, and you can take advantage of the pay-as-you-go model. BigQuery allows you to focus on analyzing data to find meaningful insights.
A newly available ecommerce dataset that has millions of Google Analytics records for the Google Merchandise Store has been loaded into BigQuery. You have a copy of that dataset for this lab and will explore the available fields and row for insights.
This lab steps you through the logic of troubleshooting queries. It provides activities within the context of a real-world scenario. Throughout the lab, imagine you're working with a new data analyst on your team, and they've provided you with their queries below to answer some questions on your ecommerce dataset. Use the answers to fix their queries to get a meaningful result.
In this lab, learn how to perform the following tasks:
For each lab, you get a new Google Cloud project and set of resources for a fixed time at no cost.
Sign in to Qwiklabs using an incognito window.
Note the lab's access time (for example, 1:15:00
), and make sure you can finish within that time.
There is no pause feature. You can restart if needed, but you have to start at the beginning.
When ready, click Start lab.
Note your lab credentials (Username and Password). You will use them to sign in to the Google Cloud Console.
Click Open Google Console.
Click Use another account and copy/paste credentials for this lab into the prompts.
If you use other credentials, you'll receive errors or incur charges.
Accept the terms and skip the recovery resource page.
In this section, you add the data-to-insights project to your environment resources.
The Welcome to BigQuery in the Cloud Console message box opens.
BigQuery public datasets are not displayed by default in the BigQuery web UI.
To open the public datasets project:
Click + ADD.
Select Star a project by name.
For Project name, enter data-to-insights
.
Click STAR.
In the left pane, under Show starred only you will see the data-to-insights project pinned.
For each activity in the following sections, this lab provides queries with common errors for you to troubleshoot. The lab directs you what to look at and suggests how to correct the syntax and return meaningful results.
To follow along with the troubleshooting and suggestions, copy and paste the query into the BigQuery EDITOR. If there are errors you see a red exclamation point at the line containing the error and in the query validator (bottom corner).
If you run the query with the errors, the query fails and the error is specified in the Job information.
When the query is error free, you see a green checkmark in the query validator. When you see the green checkmark, click RUN to run the query to view what you get for results.
Your goal in this section is to construct a query that gives you the number of unique visitors who successfully went through the checkout process for your website. The data is in the rev_transactions table which your data analyst team has provided. They have also given you example queries to help you get started in your analysis but you're not sure they're written correctly.
Look at the below query and answer the following question
What about this updated query?
What about this query that uses Standard SQL?
What about now? This query has a column.
What about now? The following query has a page title.
What about now? The missing comma has been corrected.
Answer: This returns results, but are you sure visitors aren't counted twice? Also, returning only one row answers the question of how many unique visitors reached checkout. In the next section you find a way to aggregate your results.
Aggregate the following query to answer the question: How many unique visitors reached checkout?
What about this? An aggregation function, COUNT()
, was added.
In this next query, GROUP BY
and DISTINCT
statements were added.
Results
Great! The results are good, but they look strange. Filter to just "Checkout Confirmation" in the results.
Complete the partially written query:
Possible solution
Update your previous query to order the top cities first.
Possible solution
Update your query and create a new calculated field to return the average number of products per order by city.
Possible solution
Results
Filter your aggregated results to only return cities with more than 20 avg_products_ordered.
What's wrong with the following query?
Possible solution
What's wrong with the following query? How can you fix it?
What is wrong with the following query?
Update the previous query to only count distinct products in each product category.
Possible solution
You have troubleshooted and fixed broken queries in BigQuery standard SQL. Remember to use the Query Validator for incorrect query syntax but also to be critical of your query results even if your query executes successfully.
When you have completed your lab, click End Lab. Google Cloud Skills Boost removes the resources you’ve used and cleans the account for you.
You will be given an opportunity to rate the lab experience. Select the applicable number of stars, type a comment, and then click Submit.
The number of stars indicates the following:
You can close the dialog box if you don't want to provide feedback.
For feedback, suggestions, or corrections, please use the Support tab.
Copyright 2022 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