THIS WORKED FOR ME -MYSQL WORKBENCH -- one paramter DELIMITER $$ CREATE PROCEDURE emp_sp1(dept_id INT) BEGIN SELECT * FROM employees WHERE employee_id = dept_id; END$$ DELIMITER ; -- calling S.T CALL emp_sp1(1); -- Replace 1 with the desired employee_id DROP PROCEDURE IF EXISTS emp_sp1;
Can we use it in databricks?
Yes select sql and do practice
IN MSQL WORKBENCH THE GIVEN QUERY IS NOT WOKRING
THIS WORKED FOR ME -MYSQL WORKBENCH
-- one paramter
DELIMITER $$
CREATE PROCEDURE emp_sp1(dept_id INT)
BEGIN
SELECT * FROM employees WHERE employee_id = dept_id;
END$$
DELIMITER ;
-- calling S.T
CALL emp_sp1(1); -- Replace 1 with the desired employee_id
DROP PROCEDURE IF EXISTS emp_sp1;
Yes procedure creation syntax is little bit different in MySQL and SQL server ...do Install SQL server for practice
@@learnbydoingit accha okay