title: How to design a payments database?
body: <p>I'm writing a progam to control a school.
  It's more like a membership subscription schema.
  A student applies for a course, and will have to pay an inscription ad a monthly fee, for the rest of a specific time defined by school calendar.</p>
  
  <p>Depending on each case inscription or monthly fees can be reduced for some specific student.
  Once a student subscribe to a course, it will be a recurrent payment,
  the student can make partial payments.
  Also, the student can quit, and never come back.</p>
  
  <p>I have come with something like tables this:</p>
  
  <pre><code>STUDENT
  +id
  +name
  
  COURSE
  +id
  +name
  +inscription_fee
  +monthly_fee
  
  SCHEDULED_PAYMENTS
  +id
  +student_id
  +description
  +amount
  
  -LEDGER
  +id
  +student_id
  +course_id
  +amount
  </code></pre>
  
  <p>But I ended up with long complicated queries when I want to know what a student has  paid, wich monthly fees are due, etc.</p>
  
  <p>So I ask, Is this the right way to design a database for payments? or is there a better way?</p>