Indeed. You can also use pvc pipe cement to glue pvc pipes together but before using the treated pvc pieces, make sure the smell of the cement is completely gone or leave it for 24 hours before using it for your tank.
use the purple primer and pvc cement. it melts the pipe sections together into one piece, much more structural if you will have any pressure in the pipes.
imo it may better also because there will be no play or flexibility in the joints, afterall nobody likes a loose joint.