It is difficult. Bacterial gastroenteritis can be difficult to discern from viral gastroenteritis (nausea, vomiting and diarrhea). Bacterial infection tends to cause bloody stools, higher fever, significant mucous in the stool, and companion sore throat or headache. Viral gastroenteritis tends to be less violent, the fever less dramatic, and rarely bloody stools. It may require a culture or blood test to decide.
It usually is not. Most of the time stomach bugs are caused by viruses rather than bacteria, and most of the bacterial causes are usually not treated in children. Bacterial stomach bugs are a bit more likely to cause high, prolonged fevers and bloody stools. The biggest worry with GI infections is dehydration. Make sure that your child stays hydrated and have him or her seen if you are at all concerned.