<!--- Retrieve Films and Related Actors from database --->
<CFQUERY NAME="GetFilmInfo" DATASOURCE="#REQUEST.DataSource#">
  SELECT 
    f.FilmID, f.MovieTitle, 
    a.NameFirst, a.NameLast
  FROM (Films f INNER JOIN 
       FilmsActors fa ON f.FilmID = fa.FilmID) INNER JOIN 
       Actors a ON fa.ActorID =  a.ActorID
  ORDER BY f.MovieTitle, a.NameLast
</CFQUERY>

<HTML>
<HEAD><TITLE>Films and Actors</TITLE></HEAD>
<BODY>
<H2>Films And Actors</H2>

<!--- Display retrieved information in HTML table --->
<CFTABLE QUERY="GetFilmInfo" HTMLTABLE BORDER COLHEADERS>
  <CFCOL HEADER="Film ID" TEXT="#FilmID#">
  <CFCOL HEADER="Film Title" TEXT="#MovieTitle#">
  <CFCOL HEADER="Actor (First Name)" TEXT="#NameFirst#">
  <CFCOL HEADER="Actor (Last Name)" TEXT="#NameLast#">
</CFTABLE>

</BODY>
</HTML>
