Why did the song dynasty establish civil service examinations

The Song Dynasty established civil service examinations as a way to ensure that government officials were selected based on their merit and knowledge rather than their social status or connections. This helped to create a more fair and merit-based system of government, and also increased the pool of candidates for government positions, as individuals from all social classes were able to participate in the exams. Additionally, the civil service examinations helped to promote education and literacy among the population, as individuals had to study and prepare for the exams in order to be eligible for government positions.