title: SQL query that returns the table names of a row that belongs to multiple ISA sub-components
body: <p>Having some trouble with ISA relationships and was wondering if what I was thinking is possible.</p>
  <p>Let's say I have a class entity called <code>MUSICIAN</code>.
  Then we have sub-components like <code>FLUTE class ISA MUSICIAN</code> and <code>PIANO class ISA MUSICIAN</code>.</p>
  <p>Is it possible to have a SQL query that can return a result like:</p>
  <pre><code>ID | Name   | Instrument
  
  34 | James  | PIANO
  45 | Donald | PIANO, FLUTE
  89 | Troy   | FLUTE 
  
  </code></pre>
  <p>It does not necessarily have to be the name of the sub-tables (it can be a constant for example), but I was wondering if there is a single query that can achieve this.</p>
  <p>For context: In my backend I am currently doing a <code>SELECT ID FROM MUSICIAN WHERE &lt;condition&gt;</code> and then I have a for loop that searches each sub-table based on the results I get from that query. Then I can tell what instruments they play based on the results I get back from the for loop. But even as someone relatively new to SQL, I have a feeling that this is definitely not the right way of doing it.</p>