TF Holdings Interview Question

SQL Left join and group by