Miranda Cosgrove does not appear in School of Rock (2003). The film's female lead—Rosalie Mullins, the uptight principal who warms to Jack Black's Dewey Finn—is played by Joan Cusack.
Cosgrove was 10 in 2003; her breakout came later with Drake & Josh (2004) and iCarly (2007). You may be confusing her with another child actor, or misremembering a different school-set comedy (e.g., Yours, Mine & Ours 2005, College Road Trip 2008).
School of Rock's kid cast: Rebecca Brown, Kevin Alexander Clark, Joey Gaydos Jr., Maryam Hassan, Angelo Massagli, Caitlin Hale, Robert Tsai—no Miranda Cosgrove.