Altea Healthcare interview question

live sql coding question was asked, without google lookups