The comma is used in writing to convey the idea that the which clause does not go with the immediately preceding element but with something more distant. However, this does not eliminate the abmiguity from the spoken language. There isn't any way to pronounce the comma to eliminate the ambiguity.
Semantics of the sentence eliminates the ambiguity. It is documents which contain embarrassing material. Inquiries do not contain; they are carried out and produce findings.
Language is inherently ambiguous. For instance:
John ate the sandwich in the fridge
Did he eat it in the fridge, or did he find it in the fridge? Both parses of the sentence are valid syntax, but only one makes sense.
One way you avoid ambiguity is to make the meaning so clear that there is a single correct interpretation, and the others are ridiculous.
Another way you can avoid ambiguity is to basically embrace it: there are two interpretations, but it basically doesn't matter which one you choose.
So for instance, your original sentence is works because inquiries don't contain. Suppose we have another noun there instead of inquiry:
The department shredded all the files from the box which contained embarrassing material.
Is it the files which contained embarassing material, and the box had other files which did not? Or did the box contain nothing but embarassing material?
Unless this subtle distinction is somehow very important in the overall message, who cares!
If it becomes important, the people who are communicating can seek clarification. Were there other files in the box, and what happened to those?
4Given how often this type of question gets asked (on ELU as well as here), it's obviously not that easy to grasp how exactly commas and/or the choice of which/that will convey the intended sense. Not even all native speakers consistently get it right. So maybe you should take note of alternative methods - for example, if you change it to *...shredded all those files...* it's completely unambiguous that those must be the ones containing the embarrassing material. – FumbleFingers Reinstate Monica – 2013-02-08T22:25:43.540
possible duplicate of Is there any difference between “which” and “that”?
– Mistu4u – 2013-02-09T02:45:29.8103Disagree with the close votes listing this as a duplicate; the comma is actually the important distinction here, not "that vs which". – WendiKidd – 2013-02-09T03:34:06.150
1Why not avoid the issue altogether by saying it this way: "The department shredded all inquiry files that contained embarrassing material"? That eliminates the unnecessary words "from the" & makes the S clearer. – None – 2013-02-09T07:09:55.107