ZS Associates interview question

Different SQL queries and their theory.