ZS Associates interview question

Sql queries were asked. Puzzles too