Key

The key of a song is based on the tonic.

You can tell what key a song is in by the number of sharps and flats on the staff.

SharpsFlats
KeyNumber of #KeyNumber of ♭
C0C0
G1F1
D2B♭2
A3E♭3
E4A♭4
B5D♭5
F#6G♭6
C#7C♭7

Circle of Fifths

From here