ZS Associates Interview Question

SQL Joins, Python Dictionary problems