Practice Your Skills | Dataquest
SELECT s.student_id IS NULL AS survey_missing, COUNT(*) AS n_occurences FROM performance_updated AS pu LEFT JOIN survey AS s ON pu.student_id = s.student_id GROUP BY survey_missing;
Above is the DQ solution. I have a simple query on how GROUP BY and IS NULL are interacting with each other, but I can’t seem to understand the flow of operation.
Query is that if we are using the condition IS NULL to select rows which are NULL in the table , it would mean we are discarding the NOT NULL rows from further consideration. In that case, how will GROUP BY segregate them into two different groups of IS NULL and NOT NULL as shown in the output, if we have only IS NULL rows ?
Or are we saying that IS NULL’s output will be 2 boolean values and GROUP BY segregates them ?