USE test;
DELIMITER $$
DROP PROCEDURE IF EXISTS example2$$
CREATE PROCEDURE example2( )
BEGIN
DECLARE n_american_artists INT;

SELECT COUNT(*)
INTO n_american_artists
FROM moma.artists
WHERE nationality = 'American';

SELECT CONCAT('The moma database contains ',
n_american_artists,
' American artists.');

END $$
DELIMITER ;
call example2();