So when you say "G major", that means playing a scale starting with G? So G, A, B, C, D, E, F-sharp, G. What makes D major the next in line for sharp key signatures? I see that you said A major is the one in line after that. Is it every three letters? So four sharps is considered E major?
I can't seem to find if this got answered anywhere so hopefully I'm not doubling up on information for you but here goes..
The cycle that is being presented is 5ths (the interval) - loosely meaning that if you count from C to G, with C as number 1, G is number 5 - so we can decribe the distance between these notes as a 5th.
You'll also note, that when using this pattern, each subsequent key or scale (up to a point) contains 1 more sharp than the last, to avoid some confusion about the intervals the 5ths are also counted from each subsequent scale, not just along the white keys. This is important because when you get to B major, the fifth note (and next key) is F# not F.
C major, no sharps, 5th note is G.
G major, 1 sharp, 5th note is D
D major, 2 sharps, 5th note is A
A major, 3 sharps, 5th note is E.
You'll also notice, that each new scale contains half the previous one, and the new sharp is always added as the 7th note.
Observe:
C major - [ C D E F ] [ G A B C ]
G major - 2nd half of C major first, [ G A B C ] [ D E F# G ] - sharp added to second last, or 7th note.
D major - 2nd half of G major first, [ D E F# G ] [ A B C# D ] - sharp added to second last, or 7th note
etc.
Once you exhaust the possibilty to add sharps, we can describe the sharps as flats, and the pattern continues, only now the flats decrease in number instead of increase. You can observe similar types of patterns here too..
or you can reverse the thing entirely, begin in C, next go to F (move up in 4ths) and you will be adding flats one by one where with each new scale the flat is added to the 4th note of the scale.
.........................
In regarding the understanding of the relative minors, and infact just this content above - this diagram may be helpful to you.
