Scotiabank interview question

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