Loops in BigQuery

Learn how to use BigQuery scripting to calculate Fibonacci numbers with for loops

Bence Komarniczky
Towards Data Science
4 min readJul 7, 2020

--

Ever wanted to loop around stuff in SQL? Well, you can with scripting. Let’s see how we can calculate Fibonacci numbers in BigQuery with loops.

Do the loop in BigQuery! — Photo by Claire Satera on Unsplash

I previously showed how to do Fibonacci in BigQuery with JavaScript UDFs (user-defined functions) and also talked about arrays in

--

--

Data scientist building ML products in ad-tech. I write tutorials on data science🧑‍🔬, machine learning 🤖, Julia and cloud computing ☁️.