Casafari interview question

Database querying