title: How do you SELECT on a table with a ternary relationship?
body: <p>I'm working on a learning project by designing a database for a library. The library lends books, videos, and audio. I decided for the fun of it to model people who contribute to a work as a ternary relationship. This makes it easier for, say, Quentin Tarrantino to be a Director, Author, and Actor in the same movie as well as be an author of some books, all w/o redundancy of people and the roles they play in creating a work.</p>
  
  <p>I've called the three basic entities involved Contributors, Roles, and Works.</p>
  
  <p>I'm having a problem because I'm uncertain what I'm supposed to do even in a simple case of listing a book. Will I end up with a separate row for each Contributor/Role pair? Or is there a way instead to have the resulting talbe have sort of "ad-hoc" columns (e.g. author, illustrator, translator for one book).</p>
  
  <p>It feels like using this ternary relationship has injected hierarchy into my database and I'm wondering how this is best handled (without eliminating the ternary relationship, please).</p>
  
  <p>[epilogue]
  I got my query to work just fine. Stefan, I did have an intermediary table just so you (and other reading this) know. It looks like ternary relationships provide hours of fun for the application programmers.</p>