the answer is simple. If you learn and memorize and master (or just get good at) all of the Major Scales (A, A#, B, C, C#, D, D#, E, F, F#, G, G#) you will then know the relative minors for them. Get a scale book, and once you learn all of those, you'll find that just about any piece of music, you will know what scale it is on (with the exception on eastern culture music, etc)