What is "tune"?
The naming of the tones is based on the tonic. For example, if C is the dominant tone in the numbered musical notation 1, 2, 3, 4, 5, 6, 7 if C is the dominant tone, that is C=1, it’s natural tone level is arranged in order from C (C , D, E, F, G, A, B), this is the C tone.
In the same way, in the D key, D is the main sound, that is D=1, and there are two sharps in the key signature. The scale structure of the D key is deduced, namely D, E, F#, G, A, B, C#.
The key of F has F as the main tone, namely F, G, A, Bb, C, D, E.
G tone G is the dominant tone, namely G, A, B, C, D, E, F#.