ZS Associates interview question

SQL Queries, Joins, Foreign Key, Clauses, Constraints, Puzzles