XYZ Interview Question

Sql queries