title: MYSQL: two tables and expected results
body: <p>I've two tables , Table 1 has unique ids and referrer , table 2 contain some unique ids from table 1</p>
  <p><strong>Table 1</strong></p>
  <pre><code>uniqueid    | Referrer   
  ------------------------
  abcd1234    | google.com  
  27316dsh    | google.com
  37283667    | yahoo.com
  3728ydhu    | yahoo.com
  362ydhhd    | example.com
  23819377    | google.com
  223hd782    | google.com
  2372jdyh    | yahoo.com
  qewe7182    | test.com
  </code></pre>
  <p><strong>Table 2:</strong></p>
  <pre><code>uniqueid    
  ------------
  abcd1234    
  27316dsh    
  37283667    
  3728ydhu    
  362ydhhd 
  </code></pre>
  <p><strong>Expected result</strong></p>
  <pre><code>Referrer    | Total Referrer | Referrer present in table 2 | Percent
  --------------------
  google.com  |  4             | 2                           | 50%
  yahoo.com   |  3             | 2                           | 66% 
  example.com |  1             | 1                           | 100%
  test.com    |  1             | 0                           | 0%  
  </code></pre>
  <p>What SQL Query should I use to have the expected result ?</p>