Did I use the commas properly?

Sentence: Today at school, i saw a fight, which caused me to get expelled!

No, the commas in the sentence are not used properly. Corrected sentence: "Today at school, I saw a fight which caused me to get expelled!"

Explain why?

The commas in the original sentence are not used correctly based on grammatical rules.

1. The first comma should be placed after "school" to separate the introductory phrase "Today at school" from the main clause "I saw a fight."
2. The second comma should be removed because it incorrectly separates the adjective clause "which caused me to get expelled" from the rest of the sentence. In this case, the clause "which caused me to get expelled" is essential information that identifies the fight being discussed, and therefore, it should not be set off with commas.

By making these corrections, the sentence reads as follows: "Today at school, I saw a fight which caused me to get expelled!"

Sentence 2: Today at school, I saw a bear, a type of mammal which can harm people.

Yes, in the sentence "Today at school, I saw a bear, a type of mammal which can harm people," the commas are used correctly.

1. The first comma is placed after "school" to separate the introductory phrase "Today at school" from the main clause "I saw a bear."
2. The second comma is used to offset the nonessential clause "a type of mammal which can harm people." This clause provides additional information about the bear but can be removed without changing the essential meaning of the sentence.