Complete the code to create a stored procedure that selects all records from the employees table.
CREATE PROCEDURE GetAllEmployees() BEGIN SELECT * FROM [1]; END;The stored procedure should select from the employees table to retrieve all employee records.
Complete the code to call the stored procedure named GetAllEmployees.
CALL [1]();To execute the stored procedure, use the exact procedure name GetAllEmployees with CALL.
Fix the error in the stored procedure creation by completing the missing keyword.
CREATE [1] GetEmployeeCount() BEGIN SELECT COUNT(*) FROM employees; END;The correct keyword to create a stored procedure is PROCEDURE.
Fill both blanks to create a stored procedure that takes an employee ID and returns the employee's name.
CREATE PROCEDURE GetEmployeeName([1] INT) BEGIN SELECT name FROM employees WHERE id = [2]; END;
The parameter name emp_id is used both in the procedure definition and in the WHERE clause to filter by employee ID.
Fill all three blanks to create a stored procedure that inserts a new employee with name and age.
CREATE PROCEDURE AddEmployee([1] VARCHAR(50), [2] INT) BEGIN INSERT INTO employees (name, age) VALUES ([3], [2]); END;
The procedure takes two parameters: emp_name for the employee's name and emp_age for the age. The INSERT uses emp_name and emp_age accordingly.