title: Extract data from multiple tables using SQL query
body: <p>I am trying to make a list of all the principal investigators (<code>facility_investigators</code> table in the given AACT database) of studies whose <code>official_title</code> (in the <code>studies</code> table) include the keyword 'fibrillation'. I also want the information on the sponsors of all such studies (sponsors table in AACT).</p>
  <p>I have tried the following code so far -</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT * FROM studies
  WHERE official_title ILIKE '%fibrillation%'
  </code></pre>
  <p>Above code gives me all the studies with the word fibrillation in their title.</p>
  <pre class="lang-sql prettyprint-override"><code>SELECT * FROM sponsors
  WHERE agency_class ILIKE '%NIH%'
  </code></pre>
  <p>This code will give me a full list of  studies where the sponsor is only NIH (studies on the fibrillation plus thousands of others)</p>
  <p>Similarly,</p>
  <p><code>SELECT * FROM facility_investigators</code>  gives me a full list of investigators for all the studies (studies on fibrillation plus thousands of others)</p>
  <p>Each study is identified by a unique id which is there in all the tables.</p>
  <p>I want to ask how do I combine these 3 commands to get a <strong>condensed list of only fibrillation studies with NIH as sponsor along with list of their respective investigators?</strong></p>
  <p><a href="https://i.stack.imgur.com/Pyacx.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Pyacx.png" alt="studies" /></a></p>
  <p><a href="https://i.stack.imgur.com/nYhUr.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/nYhUr.png" alt="facility_investigator" /></a></p>
  <p><a href="https://i.stack.imgur.com/Mq3tS.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Mq3tS.png" alt="Sponsors" /></a></p>