select
    uid,
    nick_name,
    achievement
from
    user_info
where
    nick_name like '牛客%号'
    and achievement BETWEEN 1200 and 2500
    and (
        EXISTS (
            select
                *
            from
                exam_record
            where
                date_format (start_time, "%Y%m") = '202109'
                and submit_time is not null
                and exam_record.uid = user_info.uid
        )
        or EXISTS (
            select
                *
            from
                practice_record
            where
                date_format (submit_time, "%Y%m") = '202109'
                and practice_record.uid = user_info.uid
        )
    )