CREATE OR REPLACE PROCEDURE 
    Sales( IN City_name VARCHAR(64) )
BEGIN
    SELECT 
        c.name AS city_name,
        SUM( s.value ) AS sales_total
    FROM
        city c
    LEFT OUTER JOIN
        sales s
    ON
        c.id = s.city_id 
    AND 
        s.day >= DATE_SUB( NOW(), INTERVAL 1 MONTH )
    WHERE
        c.name LIKE City_name
    GROUP BY
        c.id
    ORDER BY
        c.name
    ;
END