-
-
Save uncoded-ro/75a81c30fd5c148a93515cd2fd6b545f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
USE sakila; | |
DROP PROCEDURE IF EXISTS film_actors; | |
DELIMITER | | |
CREATE PROCEDURE film_actors(IN film_title VARCHAR(45), OUT no_actors INT) | |
BEGIN | |
SELECT COUNT(a.actor_id) INTO no_actors | |
FROM actor AS a | |
INNER JOIN film_actor USING(actor_id) | |
INNER JOIN film AS f USING(film_id) | |
WHERE f.title = film_title; | |
END | | |
DELIMITER ; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment