SQL User-Defined Functions - Kelly's Bytes - 1/17/25 (#112)


KELLY'S BYTES

By Kelly J. Adams

Hey!

Thanks for subscribing and here’s this weeks edition lesson:

Main Lesson: SQL User-Defined Functions

One of the big improvement I’ve made in my SQL workflow recently is using User-Defined Functions (UDFs) in BigQuery. Here’s why:

  • What it is: A UDF is a custom function you define to simplify repetitive logic in SQL queries. It can be written in SQL (my preference) or JavaScript.
  • How it helps: Reduces redundancy, improves maintainability, and ensures consistency in complex calculations.
  • Why it works: Instead of duplicating logic across queries, you put it in a single function. Now updates happen in one place, saving time and reducing errors.

For a step-by-step guide on creating UDFs and an example check out this week’s blog post:


Bite-Sized Resources

📺 Video: Learn To Properly Communicate In 41 Minutes from Tina Huang that goes into how she’s learning how to communicate better with the book, Crucial Conversations.

🎧 Podcast: [AI] SDS 849: 2025 AI and Data Science Predictions, with Sadie St. Lawrence from the SuperDataScience Podcast with Sadie St Lawrence, where they reflect on 2024 trends in AI and predict what’s coming in 2025.

📝 Post: [Data] LinkedIn post from Drew Mooney about how to be proactive and leveraging your domain knowledge.


Courses & Resources

📚 ​Excel Course​: A free course that teaches you Excel from beginner concepts like formulas and functions to more advanced concepts like Power Query.

📚 ​SQL Course​: Learn basic SQL in 4 hours going over things like aggregation, common analysis techniques and more.

📚 ​Python Course​: Goes into not only using Python to analyze data but also visualize it as well with libraries like Matplotlib.

📊 How to Become a Data Analyst: Check out my blog post on how you can become a data analyst.

📊 Data Analytics Resources: View all the resources (e.g. podcasts, courses, etc.) I used to learn data analytics.

The links for my courses are affiliate links. If you decide to purchase the course through this link, I may receive a small commission at no extra cost to you. This support helps me continue to provide content. Thank you for your support!


Until next time,

- Kelly

Kelly's Bytes

Every other Friday, I share one practical lesson, highlight a blog post, and share 3 bite-sized resources to help you upskill and stay updated.

Read more from Kelly's Bytes

KELLY'S BYTES By Kelly J. Adams Hey! Thanks for subscribing and here’s this weeks edition lesson: Main Lesson: T-Shaped Approach to Learning One of the biggest improvements I’ve made in my career planning is by adopting the T-shaped approach to skill-building. Here’s why it’s worth considering: What it is: A framework that balances deep expertise in one area (like data analytics) with broad knowledge across related areas (like business departments and industries). How it helps: It keeps your...

KELLY'S BYTES By Kelly J. Adams Hey! Thanks for subscribing and here’s this weeks edition lesson: Main Lesson: Using SQL for Better Data Analysis Recently, I’ve made improvements to my SQL Skills from SQL for Data Analysis by Cathy Tanimura. One lesson for me was the importance of using less common SQL functions, like CROSS JOINs, for more flexible analyses. Here’s why this matters: What it is: CROSS JOINs allow you to combine all rows from two datasets, which is especially useful for filling...

KELLY'S BYTES By Kelly J. Adams Hey! You might’ve noticed that I’ve changed the format of my newsletter. I’ve been spending the last few weeks really thinking about how I want to structure my content from now on. So each newsletter contains: Main Lesson: Something I’ve learned or am working on 3 bite-sized resources: Still related to data or learning new skills Main Lesson: SQL Functions Understanding how data flows into tables has been a game-changer for my SQL workflow. Here’s why:...