Payrails Interview Question

SQL question to join databases and provide a specific output