Back to blog home

Take your SQL from Good to Great: Part 5

Written by The Count Team

AutomationTransparency & auditability

Enhance your SQL skills with Part 5 of our series, focusing on User-Defined Functions (UDFs) to create custom, reusable SQL functions for more efficient data handling and analysis.

Introduction

I know I said this was a 4-part series, but who doesn’t love bonus content? This edition is all about User-Defined Functions (UDFs).

Check out the previous editions of the series using the links below:

Part 1: Common Table Expressions

Part 2: All about those dates

Part 3: The other JOINs

Part 4: Window Functions

Part 5: User-Defined Functions

User-Defined Functions

UDFs (User-Defined Functions) are a way to create bespoke functions in SQL.

For example, if I wanted to find the cube of a number, I could do the following in a query:

--bigquery syntax\nSELECT power(<COLUMN>,3) as cubed\nFROM <TABLE>