Merck Interview Question

Medium level sql queries was asked