modified sql question with issues