Which of these methods will produce the most representative sample of the student body at Southwest Middle School?

A. The librarian surveys all eighth-grade students.

B. The librarian surveys each student who enters the library one afternoon after school.

C. The librarian surveys each student who is in the library for a math club meeting.

D. The librarian randomly selects homeroom classes and surveys each student in the chosen classes.​