Bird
0
0

Given the function below, what will be the output of SELECT dbo.AddFive(10);?

medium📝 query result Q13 of 15
SQL - Stored Procedures and Functions
Given the function below, what will be the output of SELECT dbo.AddFive(10);?
CREATE FUNCTION dbo.AddFive(@num INT) RETURNS INT AS BEGIN RETURN @num + 5; END;
A5
B10
C15
DSyntax Error
Step-by-Step Solution
Solution:
  1. Step 1: Understand the function logic

    The function takes an integer input and returns the input plus 5.
  2. Step 2: Calculate the output for input 10

    10 + 5 = 15, so the function returns 15.
  3. Final Answer:

    15 -> Option C
  4. Quick Check:

    Input 10 + 5 = 15 [OK]
Quick Trick: Add input to 5 as function returns input + 5 [OK]
Common Mistakes:
  • Confusing input and output values
  • Assuming function returns input unchanged
  • Expecting syntax error due to missing parameters

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes