 The tune you hear the teens sing to the school song, "Hogwarts,  Hogwarts, Hoggy Warty Hogwarts" was written by  Mike Newell (I) (qv). The lyrics first appeared in the first  novel, "Harry Potter and the Sorcerers Stone". (Traditionally the  song can be sung to any tune the singer happens to like.)