Font size
WorksheetsCS10337 - Lecture # 10
Total questions: 10
Worksheet time: 3mins
True or False:
Stored procedures in MySQL can include transaction control statements like BEGIN, COMMIT, and
True
False
True or False:
The SIGNAL statement in MySQL is used to display query results from a stored procedure.
True
False
True or False:
User-Defined Functions (UDFs) in MySQL can return a single scalar value that can be used in a SELECT statement.
True
False
True or False:
Stored procedures always return a value that can be used inside a query.
True
False
Which of the following statements about stored procedures are TRUE?
They can have IN, OUT, and INOUT parameters.
They are created using the CREATE FUNCTION command.
They can perform actions like INSERT, UPDATE, and DELETE.
They cannot contain conditional logic.
One advantage of stored procedures is reducing client-server communication by executing multiple SQL statements in one call.
True
False
Which of the following best describes a User-Defined Function (UDF)?
It returns a single value.
It can be used directly inside SQL queries.
It can contain multiple SELECT statements and commit transactions.
It must be created using CREATE FUNCTION.
Why would a developer use the SIGNAL statement inside a stored procedure?
To display data from a SELECT query.
To raise a custom error or warning.
To commit a transaction.
To print debugging messages.
Which of the following are benefits of using stored procedures?
Reusability and abstraction.
Improved network performance.
Limited security — users must access tables directly.
Maintainability and centralized logic.
Which of the following is a rule or best practice for User-Defined Functions (UDFs)?
You should declare whether a function is DETERMINISTIC or not.
Functions can be used inside SELECT statements.
Functions can modify data in tables using UPDATE or DELETE.
A function must always return a value.
