```sql select round(sum(isKeep) / count(1), 4) as avg_ret from ( select device_id, date, case when ( exists ( select * from question_practice_detail d2 where d2.device_id = qpd.device_id and d2.date = date_add(qpd.date, interval 1 day) ) ) then 1 else 0 end as isKeep from question_practice_detail qp...