Achievers interview question

Implement this SQL query.