iBASEt interview question

they given database and write query for that