To find the ratio of the number of sixth-graders who visited the science museum to the total number of sixth-graders, we first need to determine the total number of sixth-graders.
The number of students who visited the science museum is 17, and the number who visited the history museum is 28. Therefore, the total number of sixth-graders can be calculated by adding these two numbers together:
\[ \text{Total sixth-graders} = \text{Science museum students} + \text{History museum students} = 17 + 28 = 45 \]
Next, we can establish the ratio of the number of students who visited the science museum to the total number of sixth-graders:
\[ \text{Ratio} = \frac{\text{Number of students at science museum}}{\text{Total number of sixth-graders}} = \frac{17}{45} \]
Thus, the ratio of the number of sixth-graders who visited the science museum to the total number of sixth-graders is \(\frac{17}{45}\).