Ok, I'm pulling most of this off the top of my head so I apologize for any mistakes. Also I'm assuming a four string bass in E A D G tuning.
What I'm about to show you is some basic scale stuff. This by no means covers all the complexities of different scales, but it'll give you a really good start and you'll know more than most people.
This is your basic G major scale:
G|----------------------------------------2---4---5----|
D|--------------------------2---4---5------------------|
A|------------2---3---5--------------------------------|
E|--3---5----------------------------------------------|
As you may or may not know, from the 3 on the e-string to the 5 on the d-string is one octave. Both of those are a G, so the g-major scale is really only from the 3 on the e-string to the 4 on the d-string. After that it just repeats an octave higher. So you're playing G-A-B-C-D-E-F#-G-A-B-C.
Again I'm not sure how much you know, but the distance from one fret to the next fret up is a half step and the distance from one fret to two frets away is a whole step. A major scale starts with a root note (G, in this case) and consists of a whole step, then a whole step, then a half step, then a whole step, then a whole step, then a whole step, then a half step, at which point you will be an octave above the root note and you can repeat the pattern.
Ex.
These are all the notes from G to the G an octave higher. Bolded are the notes in the G major scale.
G-G#-
A-A#-
B-
C-C#-
D-D#-
E-F-
F#-
G
Because every single major scale is the same pattern, you can take the above pattern and move it up and down the neck to play a major scale in any key. A C-major for example would be as follows.
G|--------------------------------------------7---9---10----|
D|----------------------------7---9---10--------------------|
A|-------------7---8---10------------------------------------|
E|--8---10---------------------------------------------------|
Notice that this is exactly the same pattern, just played in a different part of the neck. Basically, the note you start on is the key that that scale is in. You now can play a major scale in every key. You're the envy of piano students everywhere.
Ok, so if you're playing a song in G-major, you don't want to be stuck to just one spot on the neck, (or two if you jump up an octave).
There's actually seven different modes of the G-major scale, which will allow you to play in G-major anywhere on the neck.
Look at the following:
G|---------------------------------------------5---7---9---|
D|-------------------------------5---7---9-----------------|
A|-----------------5---7---9-------------------------------|
E|---5---7---8---------------------------------------------|
This can actually be seen as a G-Major scale. It's actually exactly the same notes as before, except you're starting on the second note of the scale rather than the root note. Instead of playing G-A-B-C-D-E-F#-G-A-B-C, you're playing A-B-C-D-E-F#-G-A-B-C-D-E. So while just playing that scale straight up won't sound the same as the first G-major scale, you can use it in a G-major song because it incorporates the exact same notes as the G major scale.
The following are some different scale shapes of G-major.
G|---------------------------------------------2---4---5----|
D|-------------------------------2---4---5------------------|
A|-----------------2---3---5--------------------------------|
E|--(2)--3---5----------------------------------------------|
G|---------------------------------------------5---7---9---|
D|-------------------------------5---7---9-----------------|
A|-----------------5---7---9-------------------------------|
E|---5---7---8---------------------------------------------|
G|--------------------------------------------------7---9---11---|
D|----------------------------------7---9---10-------------------|
A|-------------------7---9---10----------------------------------|
E|---7---8---10--------------------------------------------------|
G|-------------------------------------------------9---11---12----|
D|--------------------------------9---11---12---------------------|
A|---------------9---10---12---------------------------------------|
E|--10---12--------------------------------------------------------|
G|-------------------------------------------------------------12---14---16---|
D|------------------------------------------12---14---16----------------------|
A|-----------------------12---14---15------------------------------------------|
E|---12---14---15--------------------------------------------------------------|
You can mix these up, and combine them to form new shapes but I if I recall correctly, these ones are the simplest and cover every possible note on the G-major scale within an octave on every possible fret. Any of these shapes work exactly the same when played one octave (12 frets) higher (or lower) on the neck. Again, as with the first scale, you can move these to different spots if you're playing in different keys. I'll leave that to you to work out though.
It should also be noted that the last scale shown is an E-minor scale. Any song that's in E-minor can be played using the G-major scale. Basically any minor key uses the same notes as the major key three half steps above. Ex. E-minor = G-Major; A-minor = C-Major; F#-minor = A-major.
Hopefully all this helps and/or makes sense. I hope there's no mistakes in it though I'm sure someone will point them out if there are. There's a TON of stuff that could be added onto my post, but I think what I've given here is a good start, and I'm quite done with giving a theory lesson

. So if I were you I would become intimately familiar with those scales I posted, and practice running up and down them in every single key. Like pick, say, "Bb major" and then run through every version of that scale. Then once you've mastered these you come running back for more and I'm sure someone will be willing to feed you delicious morsels on pentatonics, whole-tones, modes, and melodic and harmonic minors. Hope I helped.