select difficult_level, sum(result = 'right')/count(*) correct_rate from question_practice_detail left join question_detail on question_detail.question_id = question_practice_detail.question_id left join user_profile on user_profile.device_id = question_practice_detail.device_id ...