I've always had trouble with commas and semicolons. My understanding is that upon division of a sentence there is an essential part called a clause, and additional parts are then separated with commas, unless they are capable of being an essential part of a sentence, in which case a semicolon is used. The additional parts that are incapable of acting as an essential part are divided based on whether they are part of the same thought, because when spoken aloud these locations should bear a natural pause.
Is my understanding of how to use the comma and semicolon correct? If not, what is the correct way? Here are some examples of the way I think it should be done:
Bob headed down to the market for groceries; the market was out of everything.
The off-ramp led on; the off-ramp designer was fired.
Bob headed down to the market for groceries, but the market was out of everything.
Bob wanted to buy groceries, the market was out of everything, and so he decided to buy hardware supplies instead.
Please don't send me anymore potatoes Mary, Tom.
The tiny bees had knees, the knees were the-bees-knees, and everyone knew it except the bees; the big bees also had knees though theirs' were not the-bees-knees.
Bob wanted to buy groceries, but the market was out of everything; Bob bought hardware supplies instead of groceries.