title: join and count query in flutter sqflite
body: <p>I have 2 tables one with names and id's and another with id's and dates,
  I am trying to figure out how to create the helper method to query the two tables and return the list of names with the number of dates associated to their id.</p>
  
  <pre><code>Name Table
     id  Name
      1 John
      2 Tom
      3 Frank
  
  Date Table
     id  Date
      1 1/3/19
      1 1/4/19
      1 1/5/19
      2 1/4/19
  
      Results:
      Name  Count
      John  3
      Tom   1
      Frank 0
  </code></pre>
  
  <p>This is as far as I have gotten just pulling back all the names.</p>
  
  <pre><code>  Future&lt;List&gt; queryAllNames() async {
      Database db = await database;
      List&lt;Map&gt; names =
          await db.query(Names, columns: [id, Name]);
      if (names.length &gt; 0) {
        return names;
      }
      return null;
    }
  </code></pre>
  
  <p>I have figured out the raw query I need from sqlite</p>
  
  <pre><code>select Name.name,  count(Date.date) from Name left join Date using(id) group by Name.name;
  </code></pre>
  
  <p>But still not able to translate to at sqflite helper method.</p>