0 votes
in Sql by
What is User-defined function? What are its various types?

1 Answer

0 votes
by

The user-defined functions in SQL are like functions in any other programming language that accept parameters, perform complex calculations, and return a value. They are written to use the logic repetitively whenever required. There are two types of SQL user-defined functions:

Scalar Function: As explained earlier, user-defined scalar functions return a single scalar value.

Table Valued Functions: User-defined table-valued functions return a table as output.

Inline: returns a table data type based on a single SELECT statement.

Multi-statement: returns a tabular result-set but, unlike inline, multiple SELECT statements can be used inside the function body.

Related questions

0 votes
asked Jun 3, 2020 in MongoDB by Robindeniel
0 votes
asked Dec 14, 2020 in Sql by SakshiSharma
...