Russell Investments interview question

what would be the sql script for this?