Complete the code to call the stored procedure named 'GetUserById' with parameter 5.
CALL GetUserById([1]);The stored procedure expects a numeric parameter, so passing 5 without quotes is correct.
Complete the code to create a stored procedure named 'AddProduct' that inserts a product with name parameter.
CREATE PROCEDURE AddProduct(IN productName VARCHAR(100)) BEGIN INSERT INTO products(name) VALUES([1]); END;
The parameter name 'productName' is used directly without quotes to insert the value.
Fix the error in the stored procedure call to 'UpdateStock' with productId and quantity parameters.
CALL UpdateStock([1], 10);
The parameter should be passed as a variable or value without quotes, so 'productId' as a string is incorrect.
Fill both blanks to declare and set an output parameter 'totalCount' in a stored procedure.
CREATE PROCEDURE CountUsers(OUT [1] INT) BEGIN SELECT COUNT(*) INTO [2] FROM users; END;
The output parameter name must be the same in declaration and in the SELECT INTO statement.
Fill all three blanks to create a stored procedure 'DeleteUser' that deletes a user by id and returns success status.
CREATE PROCEDURE DeleteUser(IN [1] INT, OUT [2] BOOLEAN) BEGIN DELETE FROM users WHERE id = [3]; SET [2] = ROW_COUNT() > 0; END;
The input parameter and WHERE clause use 'userId'. The output parameter is 'success' to indicate if a row was deleted.