Shoaling is when fish hang out together, but they don't necessarily swim together in a pattern. Cory cats are shoaling fish. They graze together, but don't swim together in line.
Schooling is when they swim together in a pattern and actually even turn together like some birds do when flying south for the winter.
It is important to have groups of their own kind whether they are schooling or shoaling fish. They sometimes get very lonely or stressed when they are the only species of their kind in the tank. Usually a minimum if 3 is recommended for them to be happy.