Some books say G7 chord is B F G, some say it's G B D F. Are there even more? Does this only happen to G7 or others as well? How will I know which one to use if "G7" is indicated on a sheet music? (mainly for piano)
With any chord, its root is important - if ony to give it a name!
The third is important to define its majorness or minorness.
The seventh part can use different notes, but with 'G7', that's defined as m7, making it a dominant chord.
The 5th belongs in there, but as the least defining part, can be and sometimes will be omitted. It doesn't bring much to the party, and in any case, that sound is contained in a harmonic of the root, so it's implicit anyway.
So, with the label G7, there'll be G B D and F. As stated, the D can go, leaving G B and F, which does fulfil the criteria.
Dependent on which instrument is being played, anything can go in any order, and anything can be doubled (or tripled). A lot (but not all) of publications use the slash notation to label chord inversions, so G7 would be root, G7/B 1st, G7/D 2nd and G7/F 3rd inversion, but that's not always the case.
Thus, faced with 'G7' on a sheet of music, one could - and usually does, play the given notes, with or without D, in an appropriate order. In fact, in a piece in key C, I often play G7 when a G chord is needed, and particularly if a bass is playing a root, I'll use an inversion, or even just play B and F.
The G7chord always has G as the lowest bass note. Above G the other three notes can appear in any order BDF , DBF , or FBD. If this is in the key of C , then never double the leading note ( which is B ). Also never double the 7th ( which is F ). Often the 5th ( D) is excluded from the G7 chord to avoid parallel fifths in the voice-leading.So using 4 notes in a Dominant seventh chord such as G7 we are left with 2 main possibilities : GGBFor GBDF This is the case with all Dominant seventh chords. Depending on your instrument I would use whichever 7th chord sounds best and is easiest to play. Play on !
Strictly speaking there is one and only one G7 chord and it is (G, B, D, F).
You need to understand a few things about harmony and voicing to fully appreciate the variety displayed in some texts. First, you are free to double up notes. So, on a guitar a common "voicing" is (G, D, F, B, D, G) and yet another is (G, B, D, G, B, F). We can, and often do, sacrifice the 5th of the dom 7 chord as it doesn't move to a chord tone in the I chord as nicely as the half steps 7-->8 and 4-->3, with the 5 being the common tone and not requiring movement. However this is not necessary. That explains the three note version as opposed to the 4 note version you are asking about.
A voicing can be chosen so that is has the desired features and is easy to play. On the guitar there are 3 note voicings use to generate chord scales. The root definitely defines the chord, the third defines its character as either major or minor, the 7th is useful for resolutions and is typically present in an authentic cadence, V7-->I, but the 5 is often omitted from all 7th chords, not just dom 7. Since the 7th chord is built of two triads, the Major in the root and the diminished on the third, one sometimes sees the chord substitution vii^o --> I or vii-7(b5) --> I. Strictly speaking this is NOT the V7 chord but serves the same purpose.
The G7 chord has four notes: G B D and F. In root position it has G at the bottom. In first inversion it has the B at the bottom, in second inversion the D, and in third inversion the F.
Those books shouldn't say B F G is G7, but in certain contexts a musician will leave a note out if it sounds better. The 'fifth' (which is what the D is, being a perfect 5th above the root note G) is most commonly discarded, being the least useful in defining the harmony.
Yes, I'm afraid it happens with all other chords.