BEGIN indicate when creating a stored procedure?
EXECRETURNS clause specify when creating a function?| QNo | Answer (Option with text) |
|---|---|
| 1 | B. A precompiled set of one or more SQL statements |
| 2 | B. CREATE PROCEDURE procedure_name (parameters) BEGIN SQL_statements END; |
| 3 | B. CALL procedure_name; |
| 4 | B. EXEC procedure_name; |
| 5 | B. The beginning of the SQL block |
| 6 | A. For performing repetitive tasks with one or more SQL queries |
| 7 | A. Improved performance due to precompilation |
| 8 | B. A function returns a value, while a stored procedure does not |
| 9 | C. Functions must return a value |
| 10 | A. CREATE FUNCTION |
| 11 | C. When you need to return a result or compute a value |
| 12 | B. The result type that the function will return |
| 13 | C. They can be used in a SELECT statement |
| 14 | B. A parameter used to pass values into the procedure or function |
| 15 | B. To pass a result back to the caller |
| 16 | B. They can be used to send values into and receive values from the procedure |
| 17 | A. INOUT parameter_name |
| 18 | B. OUT |
| 19 | A. Yes, INOUT parameters can accept multiple values |
| 20 | D. A mechanism for iterating over multiple rows of a query result |
| 21 | B. An implicit cursor is automatically created by SQL, while an explicit cursor must be declared manually |
| 22 | C. They are automatically created by SQL for DML statements |
| 23 | B. They provide more control over how rows are retrieved and processed |
| 24 | A. DECLARE, OPEN, FETCH, CLOSE |
| 25 | C. FETCH NEXT |
| 26 | A. By reducing the need for multiple round trips between the application and database |
| 27 | A. It may slow down the performance due to the extra overhead of returning the result |
| 28 | A. Minimize the use of complex queries and loops inside stored procedures |
| 29 | A. Use of cursors and loops |
| 30 | A. By minimizing the number of nested queries inside the function |