When building an application, you may have some logic in your database side implemented using scalar functions. In SQL, a scalar function is a type of function that operates on either a single value or a small number of input values and always returns a single value as output. These functions are essentially reusable blocks of code that perform calculations or manipulations on data. Here are the main characteristics of scalar functions. A scalar function has a Single Output.