Sharps and flats go with the letters (A - G); any of them can be major or minor.

How can you tell what key a piece of sheet music is written in?

Do these three things:

1. Look at the key signature
2. look at the final chord
3. look at the music

The key signature will indicate the scale that is used. However, there are two possible keys for every key signature. For example, the key signature of one sharp (an f#) may be that of G Major or that of e minor. What you have to find out is where the center of tonality is. If you look at the music and see accidentals written in that are leading tones in the minor key, such as d# in the key of e minor, that may indicate the minor key as a tonal center. Look at the final chord. Most often it will be that of the tonal center. So in this example if the piece ended on an e minor chord, it would most likely be in the key of e minor.

There are always variations and pieces that end on chords other than the tonal center. Most of the time, the above method will work. To be more accurate in finding the key, you need to understand more about cadences, scale tone triads, and harmonic progressions. In any case you need to know your scales and key signatures.


From:
Music Theory Questions and Answers