Pregunta de entrevista de hCentive

how to solve 8 queen problem? some database question.