mysql - Right join not retriving correct data
Your problem is in the WHERE clause 

WHERE A.user_id = '1'


You are creating correctly the RIGHT JOIN but this condition is forzing to showthe row only if the Log table (renamed as A) is equal to 'Y'.
You need to change this condition for example:

SELECT SUM(TIMESTAMPDIFF(MINUTE, A.start_time, A.end_time)) AS prep_time,
                    B.subject_name,
                    A.subject_id
                FROM prep_learn_log A
                RIGHT JOIN prep_subject B ON A.subject_id = B.subject_id 
                    AND B.active = 'Y'
                WHERE COALESCE(A.user_id, '1') = '1' 
                GROUP BY A.subject_id


I