These three diagrams illustrate the root position (1 3 5), first inversion (3 5 1), and second inversion (5 1 3) of the D chord.
The key of G also contains the chords B minor and F # diminished. In the following diagrams, these chords are shown in root position, first inversion and second inversion.