BNY interview question

What is the sql statement to find x given the two tables.