Loading

Quipoin Menu

Learn • Practice • Grow

sql / Functions
mcq
Direction: Choose the correct option

Q1.

What's the difference between function and procedure?
A. Procedure returns value
B. Function returns a value, procedure may not
C. Function is faster
D. Both same
Direction: Choose the correct option

Q2.

CREATE FUNCTION AnnualSalary(monthly DECIMAL) RETURNS DECIMAL DETERMINISTIC BEGIN RETURN monthly * 12; END;
What does DETERMINISTIC mean?
A. Fast function
B. Random results
C. Depends on data
D. Same inputs always return same output
Direction: Choose the correct option

Q3.

SELECT name, salary, AnnualSalary(salary) FROM employees;
Where is the function used?
A. SELECT clause
B. FROM clause
C. ORDER BY
D. WHERE clause
Direction: Choose the correct option

Q4.

CREATE FUNCTION CalculateBonus(salary DECIMAL, percentage INT) RETURNS DECIMAL BEGIN RETURN salary * percentage / 100; END;
How many parameters does this function take?
A. No parameters
B. 1 parameter
C. 2 parameters
D. 3 parameters
Direction: Choose the correct option

Q5.

How do you remove a function?
A. REMOVE FUNCTION
B. DELETE FUNCTION
C. ALTER FUNCTION
D. DROP FUNCTION