Database: cs_semester
Question: How many students, who have a GPA between 3 to 4, failed a course?
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 IS NULL AND T1.gpa BETWEEN 3 AND 4