title: Multi-table SQL select statement & cfoutput syntax
body: <p>I teach web design to high school students. Recently I introduced them to dynamic web design with SQL and coldfusion. I have been keeping it rather simple, but I do want to show them a complex SQL statement and a complex cfoutput. Unfortunately I have made the problem too complex for me to figure out! Here is a pic of my database structure:
  <img src="https://i.stack.imgur.com/I9wCr.jpg" alt=""></p>
  
  <p>I am trying to output a list of students enrolled in each class along with the session the class is offered, and the teacher who teaches the class. Here is an example of what I am trying to output<br><br>
  Robotics<br>
  Session 1<br>
  Mr. Smith<br>
  <ol><li>Fry, Karen</li><li>Johnson, Johnny</li><li>Turner, Haley</li>
  </ol><br></p>
  
  <p>And then I want to output the information for the next class, and so on.</p>
  
  <p>Here is the cfoutput code I am using:<br></p>
  
  <pre><code>&lt;cfoutput query="getRoster" group="staff"&gt;
  #firstname# #lastname#&lt;br&gt;
  #className#&lt;br&gt;
  #sessionNumber#&lt;br&gt;
  #title# #lastname#&lt;br&gt;
  &lt;cfoutput&gt;
  `&lt;ol&gt;&lt;li&gt;#lastname#, #firstname#&lt;/li&gt;&lt;/ol&gt;`
  &lt;/cfoutput&gt;
  &lt;/cfoutput&gt;
  </code></pre>