Merck interview question

Medium level sql queries was asked