I work for a well known software company now and of the 20 or so developers I work with closely I can confidently say that 50% of them don't even drink alcohol (mostly cultural) and the other 45% stick to craft beers and 5% might smoke some pot here and there but nobody really lets on.
I don't have any data but in my experience the most drug use and abuse has been in the sales org. My hunch it is a mix of personality type, environment and the way they are compensated (always a reason to party big) thing but they are best described as frat houses and make the tech side look like monasteries. And this isn't just small tech companies. Oracle, Salesforce, AWS etc.