Functions provide a power mechanism for code reuse, and offer you a good way to make your code cleaner and more understandable. They can also be used to leverage code in the Entity Framework runtime as well as in the database layer. Functions are of various types: Rowset Functions, Aggregate Functions, Ranking Functions, and Scalar Functions. Functions are either deterministic or nondeterministic. Functions are deterministic when they always return the same result any time that they are called by using a specific set of input values. Functions are nondeterministic when they could return different results every time they are called, even with the same specific set of input values.