We discuss computational and structural properties of subalgebras of polynomial rings when the base ring is a principal ideal domain (PID). The objects we study are the so-called SAGBI (subalgebra analogues of Groebner bases for ideals) bases for the subalgebras themselves and SAGBI-Groebner bases for the ideals in the subalgebras (SG bases). We will discuss how to compute these objects, and our goal is to avoid computations over the PID as much as possible. This is accomplished in part with an explicit basis of a certain toric ideal over a PID. Further we will show the existence of strong SAGBI bases for these subalgebras and give an algorithm to compute them. This latter gives an interesting tie in with integer programming.