Russell Investments Interview Question

what would be the sql script for this?