Database: cs_semester
Question: How many students taking a bachelor's degree received an A in all of the courses that they took?
SQL: SELECT COUNT(T2.student_id) FROM student AS T1 INNER JOIN registration AS T2 ON T1.student_id = T2.student_id WHERE T2.grade = 'A' AND T1.type = 'UG'