Ok, so I fixed the spellnig eror but still get the KeyError exception. I did try the query in mysql CLI and got back 2808 rows. select nouns.noun, hull_class.hull_class, count(hull_class.hull_class) AS prob_count from problems, nouns, hull_class where problems.noun_rel = nouns.noun_id and problems.hullc_rel = hull_class.hullc_id group by nouns.noun, hull_class.hull_class -scooter