Novartis Interview Question

They asked me to solve a SQL question and write the query on a paper. Difficultly was average