A nursery rhyme was a traditional Earth children's song, which typically included some kind of moral lesson.
Mother Goose was a collection of children's stories and nursery rhymes popular on Earth. (TNG: "A Matter of Perspective"; DS9: "Improbable Cause"; VOY: "Dragon's Teeth", "The Haunting of Deck Twelve")
"Ring Around the Rosie" was a game and nursery rhyme that originated on Earth around the 19th century. In 2268, the children of the Starnes Exploration Party asked Captain James T. Kirk to play with them following their discovery and introduction to the USS Enterprise landing party on Triacus. They all joined hands and circled Kirk as they sang the accompanying verses. (TOS: "And the Children Shall Lead")
In 2368, Aaron Conor recited the nursery rhyme "Humpty Dumpty" to Deanna Troi as a way to explain to her that his society on Moab IV (the "egg") would be impossible to reconstruct if the passing stellar fragment were to destroy it. (TNG: "The Masterpiece Society")
The nursery rhyme entitled "What Are Little Boys Made Of?" cited that "girls are made from sugar and spice and boys are made from snips and snails." William T. Riker referred to the rhyme, in 2368, during a discussion with the androgynous J'naii Soren. Upon hearing the rhyme, Soren interpreted the words to mean that it "makes it sound better to be female." Riker then clarified that "it's an old-fashioned way of looking at the sexes, not to say that there's no real difference between them." (TNG: "The Outcast")