In Hook theory I - section 1.1-1.2 -question

I’m just starting to learn music theory. I had a question: In Hook theory I - section 1.1-1.2 - we are shown the major scales without explanation as to why certain notes are part of that scale.

Given a note, say, D…I can figure out D major chord has D F# A by counting keys D …4th key from D is F#…3rd key from F# is A. So by doing that, I can tell that in D major scale has the notes D F# A. However, how do I know that the note E, G, B, C# also exist in the scale? Do I need to memorize that or is there a logical, step by step approach to discovering other notes in a scale?

Thanks

There is a pattern of whole and half steps in every scale. For example, a major scale is W-W-H-W-W-W-H, then looping back to the root. Every scale is just this basic pattern, but shifted in pitch. For example, minor scales begin on the 6th of major.

You’ll just have to memorize the intervals between the scale degrees.