Answers for "stored procedure mysql workbench"

SQL
3

mysql create stored procedure

-- MySQL

-- example
DELIMITER $$ -- Changes delimiter to $$ so can use ; within the procedure
CREATE PROCEDURE select_employees()
BEGIN
	select * 
	from employees 
	limit 1000; -- Use the ; symbol within the procedure
END$$ 
DELIMITER ; -- Resets the delimiter

/* syntax:
DELIMITER $$ -- Changes delimiter to $$ so can use ; within the procedure
CREATE PROCEDURE <Your-procedure-name>(<argument1><argument2>...<argumentN>)
BEGIN
	<Code-that-stored-procedure-executes>; -- Use the ; symbol within the procedure
END$$
DELIMITER ; -- Resets the delimiter
*/
Posted by: Guest on May-19-2020
0

mysql workbench procedure

DELIMITER //

CREATE PROCEDURE count_trainers_with_skill(IN description varchar(50))
BEGIN
SELECT Skill.Description ,count(Trainer.TrainerID) as NumOfTrainers
FROM Trainer, Skill, CertifiedTrainer
WHERE (Trainer.TrainerID=CertifiedTrainer.TrainerID) and CertifiedTrainer.SkillID =  Skill.SkillID and Skill.Description =description group by Skill.Description ;
END 
//
DELIMITER ;

/*Call for procedure with parameter*/
CALL count_trainers_with_skill("Shampooing");
Posted by: Guest on September-04-2021

Code answers related to "stored procedure mysql workbench"

Code answers related to "SQL"

Browse Popular Code Answers by Language