Even the most innocuous prayer made mandatory by government constitutes the establishment of a state religion. Students in public school are free to pray and are free to pray as often as they want. They can pray silently. They can even pray aloud if they are not disrupting other students. And that goes to the second issue.
Prayer is an act of faith that defies logical argument.
Those who have faith in prayer believe it can stop violence. They should, by all means, voluntarily pray for safety in the schools. Children in our schools recite the Pledge of Allegiance every day. Prayer is a personal tool for betterment to those who believe in its power. But it must be their choice.