What agreement will allow the publication of research based on (anonymized) private data?
This is a tricky question. There are established approaches for biomedical sciences, and they include specific consent forms. However, if you are talking about schools you might have minors involved, and this would much complicate any matter.

In the absence of a specific agreement between participating individuals and researchers, you need to obtain, in my opinion, the approval or waiver from an established institutional review board.

In addition, you need to be able to accurately deidentify your data, in order to make impossible to recognize the school or the subject. This is easier said than done, as just by looking at case mix, number of pupils, and type of subjects taught a very smart researcher could recognize one or more schools.

The safest way to address this would be to report only aggregate data, with effect weighs, such as done by the US National Inpatient Sample project.