IBM Interview Question

SQL question with joins Python problem on data structure