Scotiabank Interview Question

How to extract data from one table then contact table based on which column