PrepAway - Latest Free Exam Questions & Answers

Which two of the following SQL statements illustrate the proper way to invoke the scalar function DEGF_TO_C?

Given the following table:
TEMP_DATA
TEMP DATE
—– —–
45 12/25/2006
51 12/26/2006
67 12/27/2006
72 12/28/2006
34 12/29/2006
42 12/30/2006
And the following SQL statement:
CREATE FUNCTION degf_to_c (temp INTEGER)
RETURNS INTEGER
LANGUAGE SQL
CONTAINS SQL
NO EXTERNAL ACTION
DETERMINISTIC
BEGIN ATOMIC
DECLARE newtemp INTEGER;
SET newtemp = temp – 32;
SET newtemp = newtemp * 5;
RETURN newtemp / 9;
END
Which two of the following SQL statements illustrate the proper way to invoke the scalar function
DEGF_TO_C?

PrepAway - Latest Free Exam Questions & Answers

A.
VALUESdegf_to_c(32)

B.
SELECT date,degf_to_c(temp) AS temp_c FROM temp_data

C.
CALLdegf_to_c(32)

D.
SELECT * FROMTABLE(degf_to_c(temp)) AS temp_c

E.
VALUESdegf_to_c(32) AS temp_c

One Comment on “Which two of the following SQL statements illustrate the proper way to invoke the scalar function DEGF_TO_C?

  1. Chow, Kenneth KY says:

    A user-defined scalar function can be referenced in the same context that built-in functions can be referenced; that is, wherever an expression can be used in a SELECT, INSERT, UPDATE or DELETE statement. User-defined scalar functions can also be referenced in CALL, VALUES and SET statements.




    0



    0

Leave a Reply