Loading

Quipoin Menu

Learn • Practice • Grow

sql / Procedures
mcq
Direction: Choose the correct option

Q1.

What is a stored procedure?
A. Prepared SQL code saved in database
B. View
C. Index
D. Table
Direction: Choose the correct option

Q2.

CREATE PROCEDURE GetAllEmployees() BEGIN SELECT * FROM employees; END;
What does this do?
A. Creates procedure to get all employees
B. Creates view
C. Inserts data
D. Creates table
Direction: Choose the correct option

Q3.

CREATE PROCEDURE GetEmpByDept(IN dept_id INT) BEGIN SELECT * FROM employees WHERE department_id = dept_id; END;
What is dept_id?
A. Output parameter
B. Input parameter
C. Table column
D. Local variable
Direction: Choose the correct option

Q4.

CREATE PROCEDURE GetEmpCount(OUT total INT) BEGIN SELECT COUNT(*) INTO total FROM employees; END;
What does OUT do?
A. Local variable
B. Input value
C. Returns value to caller
D. Constant
Direction: Choose the correct option

Q5.

How do you execute a stored procedure?
A. DO procedure_name
B. CALL procedure_name()
C. EXEC procedure_name
D. RUN procedure_name