Old MacDonald Had a Farm is a traditional children song, that's been occasionally featured in The Simpsons. It was sung by Grampa in "Homer's Barbershop Quartet". A parody was sung by the children of Springfield Elementary School in "The Mook, the Chef, the Wife and Her Homer". The song would also be whistled by Maggie Simpson in "Whistler's Father".
Lyrics
Homer's Barbershop Quartet
Grampa: Old MacDonald had a farm.
E I E I O.
And on this farm, he had a chick.
The swingin'est chick I know.
With a wiggle wiggle here
and a wiggle wiggle there.
The Mook, the Chef, the Wife and Her Homer
Kids: Old MacDonald had to fart.
Fart fart fart fart fart.
And on this fart he had to fart.
Fart fart fart fart fart.
With a fart fart here,
and a fart fart there.
Here a fart, there a fart.
Everywhere a fart fart.
Old MacDonald had to fart.
Fart fart fart fart fart.
Whistler's Father
Maggie: (Whistles the tune of "E I E I O")
Lenny (Speaking): Now do it backwards.
Maggie: (Whistles the tune of "O I E I E")