Pergunta de entrevista da empresa IBM

coding round with easy code and a sql question