SELECT er.uid uid, 'activity1' activity FROM exam_record er INNER JOIN examination_info ei ON er.exam_id = ei.exam_id WHERE YEAR(er.start_time) = 2021 GROUP BY er.uid HAVING MIN(er.score) >= 85 UNION SELECT er.uid uid, 'activity2' activity FROM exam_record er INNER JOIN examination_info ei ON er.exam_id = ei.exam_id WHERE YEAR(er.start_time) = 2021 AND ei.difficulty = 'hard' AND er.score > 80 AND TIMESTAMPDIFF(SECOND, er.start_time, er.submit_time) < ei.duration * 30 GROUP BY er.uid ORDER BY uid;