GoodRx interview question

Hacker Rank SQL and Python Question