Yep, that's right !
you probably already know all the musical notes :
C C#/Db D D#/Eb E F F#/Gb G G#/Ab A A#/Bb B
( a # raises the pitch by a half step, a b drops the pitch by a half step. )
The notes with /'s are the same pitch, so C# = Db
Let's call a step from a note to the next a semi tone. so D to D#/Eb is a semi tone (sometimes called a half step, equals one fret up ).
A step in which we skip a note is called a tone. G to A is a tone, because we skipped G#/Ab ( sometimes called a whole step, equals two frets up )
To derive a major scale from any root take the following steps:
Find a root, let's say C ( I looove C,.. so simple to type )
take the following steps :
Tone - tone - semi tone - tone - tone - tone - semi tone
let's type t for tone and s for semitone :
C -t- D -t- E -s- F -t- G -t- A -t- B -s- C
And thus we arrive at the C major scale used earlier : C D E F G A B C
Try making some major scales for yourself, start in any place and make the tone and semi tone steps. Try playing a major scale on a string, with the open string as the root, making the same steps as above.
For a minor key or scale, we take a different combination of steps:
Tone - semi tone - tone - tone - semi tone - tone - tone
In A ( once again, easy to type )
A -t- B -s- C -t- D -t- E -s- F -t- G -t- A
And with this formula, you can make any minor scale.
So major:
T - T - S - T - T - T - S
and minor:
T - S - T - T - S - T - T
If you observed the tone, semi tone sequence carefully, you will have noticed they are the same, but start in different places !
to clarify:
T - T - S - T - T - T - S - T - T - S - T - T - T - S ( 2x major sequence )
------------------T - S - T - T - S - T - T ( the minor sequence )
This is why Cmajor and Aminor are made up of the same notes ! Which I used cleverly to avoid typing any #'s and b's
There are different ways of determining the notes in a key, but I find this one an easy one to start with, since it is very visual and easily applicable to a guitar.