
The melody comes from an old French song, and it's the same tune as the Alphabet Song.
The melody comes from an 18th-century French song, 'Ah! vous dirai-je, maman', first printed in 1761. The English words are from 'The Star', a poem by the English writer Jane Taylor published in 1806. Mozart wrote twelve piano variations on the tune (K. 265). The same melody is also sung as the Alphabet Song and 'Baa, Baa, Black Sheep'.