This is why I wanted a job in Europe - got rejected from there, so I'll be in the US. Ironically, an hour after I signed the letter (job is at NYU), the subway shooting happened. Nice reminder.
US gun policy is insane. I've lived ~23 years in India and 1 year in China, and never thought much about getting shot. (Yes, that's because I'm lucky enough not to be in a situation with Indian/Chinese police, but that is true of a lot of people in both countries). 7 years in the US and that thought does exist, and comes up at random times - telling my (college) students about the strategy for a mass shooter was quite something.
With that out of the way - I don't think the problem for school shootings is only or maybe even primarily the availability of guns. If you compare the Mexican school shooting list
here, you see someone getting in a fight with one classmate and shooting them, extortion killings, targeted assassinations, and accidental firings - things you'd expect in a place with a lot of guns and high crime. But there's only 2 incidents where someone went into their school and started spraying.
That seems to be mostly a US thing. It has to be some combination of untreated mental issues, alienation, militarism - something about the culture that is different. In fact the only country with anything similar is China's
mass-stabbing incidents in and around schools, starting in 2010. Of course there are differences too, it's not at the same frequency as the US, the lack of guns makes it less deadly, and most of the perpetrators are adults not students.