Josh Software interview question

A few database queries