The key signature tells you which notes should be played as sharpA semitone higher in pitch or flatA semitone lower in pitch throughout a piece of music and therefore what key the piece should be played in.
The examples above show how the keys of G major and F major are represented.
You learn about four keys at National 5:
C major
F major
G major
A minor
These are only a few of the more common examples of musical keys. There are many more keys that you may be required to learn and play a piece of music in.
Accidentals
When a composer wants to include a one-off sharp or flat, or cancel one that is in the key signature, they use accidentals.
Accidentals only apply to one bar of the music, not the whole piece.