Purchase Solution

simple SQL program demonstrating the use of CREATE FUNCTION command in SQL

Not what you're looking for?

Ask Custom Question

I need a simple SQL program demonstrating the use of CREATE FUNCTION command in SQL. A create table can be used to generate a simple record of items such as name, title, age. The Create Function command will be used to retrieve one specific value.

The program should demonstrate and show how you can pass a variable in and output a variable. Anything that would demonstrate this concept would be great. I am open to any ideas.

Purchase this Solution

Solution Summary

This job models a simple SQL program demonstrating the use of CREATE FUNCTION command in SQL.

Solution Preview

The CREATE FUNCTION (SQL Scalar, Table, or Row) statement is used to define a user-defined SQL scalar, table, or row function. A scalar function returns a single value each time it is invoked, and is generally valid wherever an SQL expression is valid. A table function can be used in a FROM clause and returns a table. A row function can be used as a transform function and returns a row.
Valid only if RETURNS specifies a table (TABLE column-list)
Valid only if RETURNS specifies a scalar result (data-type2)

Example 1: (which return table)
CREATE FUNCTION DEPTEMPLOYEES (DEPTNO CHAR(3))
RETURNS TABLE (EMPNO CHAR(6),
LASTNAME ...

Purchase this Solution


Free BrainMass Quizzes
Geometry - Real Life Application Problems

Understanding of how geometry applies to in real-world contexts

Multiplying Complex Numbers

This is a short quiz to check your understanding of multiplication of complex numbers in rectangular form.

Solving quadratic inequalities

This quiz test you on how well you are familiar with solving quadratic inequalities.

Exponential Expressions

In this quiz, you will have a chance to practice basic terminology of exponential expressions and how to evaluate them.

Probability Quiz

Some questions on probability