title: custom request with join create query builder
body: <p>I have a table "note" with a "matiere_id", I have a table "matiere" with a field name.
  I would like to display the average of the notes by subject.
  I do not know how to write my request with symfony4.</p>
  
  <p>in my repository : </p>
  
  <pre><code>public function findTest($id)
      {
          return $this -&gt; createQueryBuilder ( 'n' )
              -&gt;select("avg(n.note) as note_avg")
              -&gt;where('n.idMatiere = :idMatiere')
              -&gt;groupBy('n.idMatiere')
              -&gt;setParameter('idMatiere', $id)
              -&gt;getQuery();
      }
  </code></pre>
  
  <p>in my controlleur : </p>
  
  <pre><code> $repo = $this-&gt;getDoctrine()-&gt;getRepository(Notation::class);
          $tabMatieres = $this-&gt;getDoctrine()
              -&gt;getRepository(Matiere::class)
              -&gt;findBy([], ['nom' =&gt; 'ASC']);
  
          $tests = $repo-&gt;findTest ();
  </code></pre>