A note name alone does not tell you its role in a melody. In a D-major scale, D is the first degree and A is the fifth. In a different key, the same note A can occupy another degree. Scale degrees let musicians describe a relationship that can be carried from one key to another.
Solfège gives these positions familiar syllables: in movable-do practice the first degree is do, followed by re and mi. The pattern of relationships stays recognisable when the whole melody is transposed.