select course_id, course_name , round(100*sum(if_on)/count(if_on),2) as attend_rate from ( select course_name, course_id, user_id , if(sum(timestampdiff(minute,in_datetime,out_datetime))>=10,1,0) as if_on from course_tb left join behavior_tb using(course_id) le...