Where did you paste the code from? It uses the rowsByIndex property, so it is clearly meant for use with jstl tag (and it is written by someone who knew it). On the other hand, using two nested forEach clauses makes no sense in this context: you are going to end up with a separate option for each of the students data (name, last name, whatever), instead of a single option for a single student. It looks as if the original code was for a data grid of some kind, and has been modified without a trace of understanding.
With all due respect, I share the view that you are not ready to write the application - and you are not going to learn much by trying, as you will soon come to harder and harder topics. If you are forced to continue the application, try dumping JSF and concentrate on JSP/JSTL, I believe it has less caveats for a beginner and it will make it easier for you to learn the basics of web applications.
That said, the answer you are looking for is:
<sql:setDataSource dataSource="jdbc/db" />
<sql:query var="students">
select * from students
</sql:query>
<form action="student/studentQueryResponse.jsp">
<strong>Select a student:</strong>
<select name="studentID">
<c:forEach var="row" items="${students.rowsByIndex}">
<option id="<c:out value="${row[0]}"/>"><c:out value="${row[1]}"/></option>
</c:forEach>
</select>
<input type="submit" value="submit" name="submit" />
</form>
You will have to substitute the sql query with your own, and you will have to register a datasource jdbc/db in your application server and in the web.xml file. Of course, you will also need a MySQL driver. I assumed that you willl need student's id and that it is the first column of your query.