Bird
0
0

Which of the following is the correct way to call a SQL function named getDiscount in a SELECT statement?

easy📝 Syntax Q3 of 15
SQL - Stored Procedures and Functions
Which of the following is the correct way to call a SQL function named getDiscount in a SELECT statement?
AEXEC getDiscount(100);
BCALL getDiscount(100);
CSELECT getDiscount(100);
DRUN getDiscount(100);
Step-by-Step Solution
Solution:
  1. Step 1: Identify function call syntax in SQL

    Functions are called directly in SELECT statements using their name and parameters.
  2. Step 2: Differentiate from procedure call syntax

    Procedures use CALL or EXEC, not functions.
  3. Final Answer:

    SELECT getDiscount(100); is the correct syntax to call a function -> Option C
  4. Quick Check:

    Function call in SELECT = SELECT functionName(params) [OK]
Quick Trick: Use SELECT for functions, CALL for procedures [OK]
Common Mistakes:
  • Using CALL to invoke functions
  • Using EXEC for functions
  • Confusing function and procedure call syntax

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes