Model N interview question

SQL query joins