CREATE OR REPLACE PROCEDURE 
    Locations( IN Short_word VARCHAR(64) )
BEGIN
    SELECT
        l.title AS title, 
        l.location AS location,
        l.date AS date
    FROM
        abbrev a,
        word w,
        word_location wl,
        location l
    WHERE
        a.word_id = w.id
    AND
        wl.word_id = word.id
    AND
        wl.location_id = l.id
    AND
        a.abbrev = Short_word
    ORDER BY
        l.date DESC,
        l.title ASC
    ;
END
