MedCo (AL) interview question

Write SQL query