cleaned up sql queries -- explicitly naming order states for all