Refactor SQL in item_ordered? method.