update select queries to select person id queries