Pregunta de entrevista de PayCraft Solutions

Sql queries, coding problem, some time puzzle asked