title: How do I write a SQL query to display course_id, course_name and fee collected from each course?
body: <p>The various tables and their columns are:</p>
  
  <p>1)Course</p>
  
  <pre><code>course_id
  course_name
  duration
  fee
  </code></pre>
  
  <p>2)Registration</p>
  
  <pre><code>course_id
  stud_id
  doj
  </code></pre>
  
  <p>3)Student</p>
  
  <pre><code>stud_id
  first_name
  last name
  city
  dob
  </code></pre>
  
  <p>I have tried:</p>
  
  <pre><code>SELECT 
      C.COURSE_ID,
      C. COURSE_NAME, 
      COUNT(R.COURSE_ID) * FEES AS TOTAL_FEES 
  FROM 
      COURSE C, 
      REGISTRATION R, 
  WHERE 
      C.COURSE_ID = R.COURSE_ID 
  GROUP BY 
      R.COURSE_ID
  </code></pre>