CellarStone interview question

sql queries