CitiusTech interview question

solve sql queries