Coding Challenge: Loop Through a List of Columns
Complete this hands-on exercise to loop through a list of columns.
We'll cover the following
Problem
One of our models, raw_products.sql
, stores two ids, category_id
and product_id
, as strings, although they’re integers. This is not ideal because BigQuery performs better when filtering and joining with integers.
Tasks
We’ve created a new file, products.sql
. Inside that file, write a model that converts all the ID columns to integers using some dynamic logic.
Playground
Add your solution code in the widget below.
Get hands-on with 1400+ tech skills courses.