BOLD Interview Question

Regarding Db queries