Jefferies interview question

Basic SQL, C++