Simple stored procedure with input
SQL
Easy
3 views
Problem Description
Create a stored procedure sp_add_department(p_id, p_name) that inserts into Departments.
Input Format
SQL procedure
Output Format
Procedure created
Sample Test Case
Input:
Departments(dept_id, dept_name)
Output:
Procedure created
Constraints
Syntax close to MySQL style
Official Solution
CREATE PROCEDURE sp_add_department(IN p_id INT, IN p_name VARCHAR(100)) BEGIN INSERT INTO Departments(dept_id, dept_name) VALUES (p_id, p_name); END;
Solutions (0)
No solutions submitted yet. Be the first!
No comments yet. Start the discussion!