Unlock the power of your data in the cloud! Get hands-on with Google Cloud's core data services like BigQuery and Looker to validate your practical skills in data ingestion, analysis, and management, and earn your Associate Data Practitioner certification!
Prepare and test your skills
Prepare and test your skills
Worked example. The correct answer is already marked and every option is explained below, so there is nothing to select here. To answer questions yourself, start the free trial.
A data practitioner has loaded a raw customer transactions table into BigQuery. The dataset contains several data quality issues that need to be resolved before downstream business intelligence reports can consume it:
transaction_id, and only the most recent entry should be retained.customer_email column are represented as NULL and need a fallback value of 'unknown@example.com'.transaction_date column is formatted as string text ('YYYY/MM/DD') and must be converted to a DATE type safely without failing the query if an invalid string is encountered.Which combination of BigQuery SQL techniques should the practitioner use to clean and prepare this dataset?
This approach leverages BigQuery Standard SQL analytical functions and safe conversion operators to perform multi-step data cleansing directly in the data warehouse. By combining window partitioning, conditional null replacement, and safe type transformation, data practitioners can clean messy raw data into a reliable, standardized schema for downstream analytics.
QUALIFY ROW_NUMBER()): The ROW_NUMBER() window function partitions rows by transaction_id and orders them descending by transaction_date. Applying the QUALIFY clause with = 1 filters out any older duplicate records and retains only the single latest entry per transaction ID in a single query pass without requiring complex self-joins or subqueries.COALESCE): The COALESCE() function returns the first non-null expression in its argument list. Evaluating COALESCE(customer_email, 'unknown@example.com') preserves valid email addresses while safely substituting NULL values with the designated placeholder.SAFE.PARSE_DATE): The PARSE_DATE() function converts custom string patterns into standardized DATE objects (YYYY-MM-DD). Prefixing with the SAFE. operator ensures that any improperly formatted strings return NULL instead of generating runtime exceptions that would terminate the entire query.QUALIFY clause operates directly on window function results after WHERE, GROUP BY, and HAVING filters, optimizing compute performance in BigQuery.SAFE. prefix prevents batch pipeline crashes caused by isolated bad records or malformed strings.OVER() clause ensures reproducible selection of the most recent record.Using native BigQuery SQL capabilities allows data transformations and cleansing to occur directly inside BigQuery's distributed compute engine (ELT pattern). This eliminates the overhead of moving raw data out to external tools or running multiple intermediate table writes.
Keep the momentum going with these hand-picked practice scenarios
Want more questions like this?
Get a free certification question every week.