ZS Associates interview question

Puzzles, Guesstimates, Sql queries, DBMS.