Below is an article about how relative majors and minors work. You can find demonstrations and notation of all harmonic and melodic minor scales here.
Before learning about relative minors, it helps to be familiar with major keys and key signatures.

■Every major key has a relative minor. The letter name or key note of the relative minor is three semitones down from the key note of the relative major. Eg. A is three semitones below C, so A minor is the relative minor of C major.
■Relative minors and majors always share the same key signature. So if C major has no key signature, A minor also has no key signature.
■However minor keys also have additional sharps in the form of accidentals. This means these extra sharps are not written in the key signature and they are more variable.
■Most commonly, the 7th degree of the scale is sharpened - shown in the harmonic minor scale. In A minor this would be G sharp.
■Both the 6th and 7th can be sharpened - shown in the melodic minor scale ascending, and in A minor this would become F sharp and G sharp.
■It’s also possible to have no accidentals and for the notes to only follow the key signature - as in the melodic minor scale descending only, or the natural minor scale (both ascending and descending).
■Relative minors and majors always share the same key signature. So if C major has no key signature, A minor also has no key signature.
■However minor keys also have additional sharps in the form of accidentals. This means these extra sharps are not written in the key signature and they are more variable.
■Most commonly, the 7th degree of the scale is sharpened - shown in the harmonic minor scale. In A minor this would be G sharp.
■Both the 6th and 7th can be sharpened - shown in the melodic minor scale ascending, and in A minor this would become F sharp and G sharp.
■It’s also possible to have no accidentals and for the notes to only follow the key signature - as in the melodic minor scale descending only, or the natural minor scale (both ascending and descending).
A piece in a minor key tends to use a combination of these different forms of the minor scale. Even if it’s using the natural minor scale which ends up having exactly the same notes as the relative major, it will still sound like the minor not the major because the harmonic progressions will be different as they will be based on a scale with different starting and finishing notes (Eg. A to A instead of C to C) and the tonic triad of the minor will be used more often.
To sum up:
■Minors have the same key signature as the relative major.
■The natural minor scale has exactly the same sharps or flats as it’s relative major, it just starts and ends on different notes.
■The harmonic minor again has the same key signature as the relative major, plus the raised seventh degree of the scale (raising the seventh can alter the effect of the key signature, as in B natural in C harmonic minor. C minor has 3 flats in the key signature: B, E, A. Raising the 7th changes B flat to B natural. The key signature is still written as 3 flats, and the B natural is shown by accidentals. See picture below).
■The melodic minor scale (again) shares the same key signature as the relative major plus has the raised 6th and 7th going up, but no accidentals coming down (just follows key signature).
To sum up:
■Minors have the same key signature as the relative major.
■The natural minor scale has exactly the same sharps or flats as it’s relative major, it just starts and ends on different notes.
■The harmonic minor again has the same key signature as the relative major, plus the raised seventh degree of the scale (raising the seventh can alter the effect of the key signature, as in B natural in C harmonic minor. C minor has 3 flats in the key signature: B, E, A. Raising the 7th changes B flat to B natural. The key signature is still written as 3 flats, and the B natural is shown by accidentals. See picture below).
■The melodic minor scale (again) shares the same key signature as the relative major plus has the raised 6th and 7th going up, but no accidentals coming down (just follows key signature).
To use another example:
■G major is related to E minor so they both have F sharp in the key signature.
■E harmonic minor has the raised 7th as an accidental - D sharp. So an E harmonic minor scale will contain both F sharp and D sharp.
■The melodic minor scale ascending has the raised 6th and 7th - C sharp and D sharp as accidentals, in addition to the F sharp which is in the key signature.
■The melodic minor descending has no raised 6th or 7th (no accidentals), it just follows the key signature which is F sharp (as does the natural minor form).
■G major is related to E minor so they both have F sharp in the key signature.
■E harmonic minor has the raised 7th as an accidental - D sharp. So an E harmonic minor scale will contain both F sharp and D sharp.
■The melodic minor scale ascending has the raised 6th and 7th - C sharp and D sharp as accidentals, in addition to the F sharp which is in the key signature.
■The melodic minor descending has no raised 6th or 7th (no accidentals), it just follows the key signature which is F sharp (as does the natural minor form).
Below is a picture showing the 3 different forms of C minor.
■The relative major of C minor is E flat major, so they both share the same key signature of 3 flats.
■The seventh degree of the scale in C minor is B flat, so in the harmonic minor, the raised 7th becomes B natural.
■In the melodic minor ascending, the sixth and seventh are raised, so A flat and B flat become A natural and B natural, but return to A flat and B flat when descending.
■The natural minor just follows the key signature
■The seventh degree of the scale in C minor is B flat, so in the harmonic minor, the raised 7th becomes B natural.
■In the melodic minor ascending, the sixth and seventh are raised, so A flat and B flat become A natural and B natural, but return to A flat and B flat when descending.
■The natural minor just follows the key signature