The majority of stingrays swim by pulsating their bodies like a wave. Other stingrays flap their wing-like cartilages to propel themselves forward. Some types of stingrays also use their tail to steer themselves.
However, the main purpose of the tail is for defense (read how do stingrays sting for more information). A stingray’s stinger, spine, or barb, can have serrated edges and a sharp point.
To swim, some stingrays move their whole bodies in a wavy motion that propels them through the water. Other species flap their fins like bird wings and “fly” through the water.National Geographic Kids
Those that use undulatory (wave-like) movement patterns have shorter thicker fins. Stingrays that use oscillatory movement have longer thinner pectoral fins. You can read more about this here.
Their swimming style has also drawn the interest of scientist and engineers who aim to replicate this type of swimming in submarines.
Scientists at Harvard University and the University at Buffalo are studying how stingrays move, including the apparently easy way their round and flattened bodies ripple through the water.
While stingrays are usually calm creatures they can and will attack if they feel threatened. Thus, it is dangerous to swim with stingray and try to avoid them while swimming or snorkeling.