How many students that are undergoing the pre-phase of qualification have advisors?
students refers to student = 1 and ; undergoing the phase of pre-qualification refers to inPhase = 'Pre-Quals'; have advisors refers to advisedBy.p_id
SELECT COUNT(T1.p_id_dummy) FROM advisedBy AS T1 INNER JOIN person AS T2 ON T1.p_id = T2.p_id WHERE T2.inPhase = 'Pre_Quals' AND T2.student = 1