Wise Cells interview question

The most difficult question was from database