C
The tonic is the 1st note in the scale. For example, in the G major scale, G is the tonic.
The subdominant note is the fourth scale degree of any key, for example in C major the subdominant note is F since the scale goes C D E F G A B C.
The tonic note of any diatonic scale is the first note (starting note) of the scale. In the case of G-flat major the tonic note is G-flat!
The fifth note of C major scale is G. The fifth note of any scale is always called the dominant.
G major
C
f#
The dominant note is the 5th note in the scale. ie: in a C Major scale, G is the dominant note. The dominant is represented by the Roman Numeral "V" in music.
The keyword "g" in the C major scale represents the seventh note, which creates a sense of tension and leads back to the first note, completing the scale.
B major's submediant note is g#
F sharp
The interval between the notes D and G is a perfect fourth.