Aimpoint Digital interview question

Joins in sql, errors in code