Leap & Scale interview question

Sql queries