What is the major scale?
The major scale is the do-re-mi sound: whole, whole, half, whole, whole, whole, half. It is also the Ionian mode, the first of the seven modes, and every interval name (♭3, ♯4, ♭7) is measured against it.
D major has the notes D E F♯ G A B C♯. The major 3rd (F♯) makes it sound happy; the major 7th (C♯) pulls hard back up to D.
D major vs D natural minor
6 notes differ. Play both and listen for the 3rd and 6th and 7th.
How to hear it
Play the scale up and stop on C♯, the 7th. You will feel it lean towards D. That pull is the major scale's centre of gravity, and it is why melodies in D major sound finished when they land on D.
Chords in D major
Stack every other note and you get the seven chords of the key. D, G and A (I, IV and V) carry most songs ever written.
Questions
What is the relative minor of D major?
B natural minor. It uses exactly the same notes as D major, starting from the 6th.
Is the major scale the same as Ionian?
Yes. Ionian is the major scale’s name as a mode. The site uses “major” for the page and explains the mode name here.
Which position should I learn first?
Start with the position that begins on the root: D at fret 10 on the low E string. Then learn the positions either side of it, and join them up one at a time.