PDE Preparing and Using Data for Analysis Practice Question
You are using BigQuery to analyze a dataset. You need to create a new table that contains only rows from `sales` where the `region` is 'North America' and the `sale_date` is in the year 2023. You also want to add a column `sale_month` that extracts the month from `sale_date`. Which two actions should you take? (Choose two.)
⚠ Common exam trap
A common mix-up: candidates confuse row filtering with aggregation filtering, or using formatting functions instead of extraction functions for date parts.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Use the EXTRACT function in the SELECT list to create the `sale_month` column.
To filter rows by region and date, a WHERE clause is required. To add a new column with the month, use the EXTRACT function in the SELECT list. HAVING is for aggregated groups, FORMAT_DATE returns a string, and LIMIT does not filter conditionally. Thus, the correct actions are using a WHERE clause and using EXTRACT.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Use the FORMAT_DATE function to create the `sale_month` column.
Why it's wrong here
FORMAT_DATE is used to format a date as a string, not to extract an integer month. While you could use FORMAT_DATE('%m', sale_date) to get a two-digit month string, the requirement is to extract the month, which typically implies an integer. EXTRACT(MONTH FROM sale_date) is the direct and correct function. FORMAT_DATE would return a string, which may not be desired and is less efficient.
- ✓
Use the EXTRACT function in the SELECT list to create the `sale_month` column.
Why this is correct
To add a column that extracts the month from a date, you use the EXTRACT function: `EXTRACT(MONTH FROM sale_date) AS sale_month`. This returns an integer representing the month. You can include this expression in the SELECT list of your query, and when you create a table from the query, the new column will be included. This is the correct way to derive the month from a date column.
- ✗
Use a LIMIT clause to restrict the number of rows to only those in 2023.
Why it's wrong here
LIMIT restricts the number of rows returned but does not filter based on conditions. It cannot ensure that only rows from 2023 are included; it would simply take an arbitrary number of rows. To filter by year, you need a WHERE clause with a date condition. LIMIT is used for sampling or previewing, not for conditional filtering.
- ✗
Use a HAVING clause to filter on `region` and `sale_date`.
Why it's wrong here
The HAVING clause is used to filter groups after aggregation, not individual rows. Since there is no aggregation in this scenario, using HAVING would be incorrect. It would also cause an error if used without GROUP BY. The WHERE clause is the correct place to filter rows before any grouping. This is a common mistake for those familiar with SQL but not the specific semantics of HAVING.
- ✓
Use a WHERE clause with conditions on `region` and `sale_date`.
Why this is correct
To filter rows, you use a WHERE clause. For the region condition, you can write `region = 'North America'`. For the date condition, you can use `EXTRACT(YEAR FROM sale_date) = 2023` or a range like `sale_date BETWEEN '2023-01-01' AND '2023-12-31'`. This is the standard way to restrict rows in a query. Combining both conditions with AND ensures only rows meeting both criteria are included.
About these practice questions
This PDE question is part of Courseiva's 747-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Google Cloud exam blueprint
This PDE practice question is part of Courseiva's free Google Cloud certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the PDE exam.