Pergunta de entrevista da empresa hCentive

how to solve 8 queen problem? some database question.