May 2020
Beginner
564 pages
14h 9m
English
Let's begin by dropping the procedure that you created in the preceding section with the following code:
USE lahmansbaseballdb;DROP PROCEDURE IF EXISTS getplayergameinfo;
Next, you will create the procedure, but this time, it will also have an OUT parameter:
USE lahmansbaseballdb;DELIMITER $$CREATE PROCEDURE getplayergameinfo(IN yearid_in year,IN h_in smallint, OUT countplayers smallint)BEGIN SELECT COUNT(p.playerid) INTO countplayers FROM appearances AS a JOIN people AS p ON p.playerid = a.playerid JOIN batting AS b ON a.playerid = b.playerid AND a.yearid = b.yearid AND a.teamid = b.teamid WHERE b.yearid = yearid_in AND h > h_in ORDER BY p.playerid, a.yearid, a.teamid, G_defense, H;END $$DELIMITER ;
You will see a couple ...
Read now
Unlock full access