title: Fill missing dates in PostgreSQL with zero
body: <p>I've a query like this in PostgreSQL:</p>
  
  <pre><code>select count(id_student) students, date_beginning_course from 
  data.sessions_courses
  left join my_schema.students on id_session_course=id_sesion 
  where course_name='First course'
  group by date_beginning_course
  </code></pre>
  
  <p>What I obtain with this query is the number of students that have attended a session of "First course" in several dates, for example:</p>
  
  <pre><code>Students  Date_beginning_course
  ____________________________________
  
  5         2019-06-26
  1         2019-06-28
  5         2019-06-30
  6         2019-07-01
  2         2019-07-02
  </code></pre>
  
  <p>I'd like to fill this table with the missing date values, and, for each missing value, assign a '0' in Students column, because there are no students for this date. Example:</p>
  
  <pre><code>Students  Date_beginning_course
  ____________________________________
  
  5         2019-06-26
  0         2019-06-27  &lt;--new row
  1         2019-06-28
  0         2019-06-29  &lt;--new row
  5         2019-06-30
  6         2019-07-01
  2         2019-07-02
  </code></pre>
  
  <p>Could you help me? Thanks! :)</p>