USE test;
DELIMITER $$
DROP FUNCTION IF EXISTS nartists$$
CREATE FUNCTION nartists(nation VARCHAR(255))
RETURNS INT

BEGIN
DECLARE n_artists INT;

SELECT COUNT(*)
INTO n_artists
FROM moma.artists
WHERE nationality = nation;

RETURN n_artists;

END $$
DELIMITER ;
SELECT nartists('Belgian');