title: How to get distinct counts for values in columns
body: <p>I have a table and two of it's columns look like this:</p>
  <pre><code>Name        cars_owned
  Adam        Audi
  David       BMW
  Steve       Ford
  John        Audi
  Adam        Audi
  ....This continues on for ~1,000 rows
  </code></pre>
  <p>I want an output like this:</p>
  <pre><code>cars_owned     count
  Audi           3
  BMW            1
  Ford           1
  ...
  </code></pre>
  <p>The issue is rows can be repeated, meaning 'Adam' and 'Audi' might appear together 100 times but for the name 'Adam' I want it to just count as one for the Audi counts regardless of however many times it appears in the table. Additionally 'Adam'  might appear with 'Audi' 20 times but also appear with 'BMW' 5 times, in this case I want 'Adam' to only get into the Audi count as that appears more times than with BMW</p>
  <p>I was able to get a count of the distinct names (247) using this code:</p>
  <pre><code>SELECT COUNT(DISTINCT Name)
  FROM cars_table
  </code></pre>
  <p>Now I just need to break those 247 distinct names into the correct cars_owned categories to get the counts</p>