The particular letter used for the index of a sum doesn't matter. So the letter \(q\) used to index the second sum may be replaced with the letter \(p\), making this problem just like problem 8.2.4.
\(\displaystyle\sum_{p=0}^6p^2\)