Stored Procedures

📝 Stored Procedures

Total Questions: 7
Click an answer to select it, then click "Check Answers" to see your results.
Question 1

Which SQL keyword is used to create a stored procedure in a database?

A.

A) CREATE FUNCTION

B.

B) CREATE PROCEDURE

C.

C) CREATE TRIGGER

D.

D) CREATE TABLE

Question 2

Why is **DELIMITER //** necessary when creating a stored procedure?

A.

A) To mark the end of the database connection

B.

B) To separate multiple procedures in one script

C.

C) To prevent internal semicolons from terminating the procedure definition prematurely

D.

D) To optimize the procedure's execution speed

Question 3

In the context of stored procedures, what is the primary purpose of the **BEGIN...END** block?

A.

A) To group multiple SQL statements into a single logical unit

B.

B) To declare variables only

C.

C) To define the procedure name

D.

D) To establish the database connection

Question 4

In the syntax for creating a stored procedure with parameters, what precedes the parameter name and data type?

A.

A) OUT

B.

B) IN, OUT, or INOUT

C.

C) @

D.

D) DELIMITER

Question 5

What keyword is used to execute a stored procedure with arguments?

A.

A. EXECUTE

B.

B. RUN

C.

C. CALL

D.

D. INVOKE

Question 6

Which keyword is used to declare a variable inside a stored procedure in MySQL?

A.

A) DEFINE

B.

B) DECLARE

C.

C) SET

D.

D) INITIALIZE

Question 7

What happens if the condition in an **IF** statement is false?

A.

A. The statements in the IF block execute.

B.

B. The procedure terminates immediately.

C.

C. No statements execute.

D.

D. The statements in the ELSE block execute.

Quiz Complete!

Score: 0 / 7