IntegraFEC interview question

Gave and SQL question