Bloomberg Interview Question

Write a SQL query with criterion where if there is this table and other table