title: SQL how percent totals from two tables change over time
body: <p>Hi there I have a question regarding SQL structure. I have some of it figured out but I cant get the rest.</p>
  
  <p>USERS TABLE</p>
  
  <pre><code>user    OS_signup
  1       Mobile
  2       Windows
  3       Mac
  4       Mobile
  5       Windows
  </code></pre>
  
  <p>DUNGEON TABLE</p>
  
  <pre><code>    user  dungeon     progress  status      OS_completed  deaths
      1     Dungeon 1   1         finished    Windows       0
      1     Dungeon 1   2         incomplete  Windows       0
      2     Dungeon 2   1         finished    Windows       1
      3     Dungeon 2   1         finished    Mac           1
      3     Dungeon 1   2         finished    Mac           3
      3     Dungeon 3   3         incomplete  Mac           0
      4     Dungeon 1   1         finished    Mobile        1
      5     Dungeon 1   1         incomplete  Windows       5
  </code></pre>
  
  <p>Which operating system is most popular when comparing the percent of users that completed the first level of progress of the first dungeon vs. users who have an account on the game? </p>
  
  <p>I have this query</p>
  
  <pre><code>SELECT OS_signup, count(*) AS count_total
  FROM users
  GROUP BY OS_signup
  </code></pre>
  
  <p>and this one</p>
  
  <pre><code>SELECT OS_completed, count(*) AS count_completed
  FROM dungeons
  WHERE dungeon = "Dungeon 1" AND progress &gt;=1 AND status = "finished"
  GROUP BY OS_completed
  </code></pre>
  
  <p>I obviously get two tables, but I want to write a query that outputs a combined table so that I get one table that looks like this:</p>
  
  <pre><code>OS          percent-done
  Mobile      0.5
  Windows     0.5
  Mac         1
  </code></pre>
  
  <p>How can I write a query to achieve a table like the above? </p>
  
  <p>Thank you!</p>