title: Creating Stored Procedures
body: <p>Write the DDL script to make a stored procedure that returns data needed to display a grade book screen for a professor. The only input for the stored procedure is a ClassId. Outputs need to include student names and grades for all assignments as well as a calculated overall grade for the class for each student. Provide an example calling this new stored procedure, passing it parameter values of your choice. Include a screenshot of the output.</p>
  
  <p>I am unsure how to write this in stored procedure. I don't really understand what is my parameter. I know my input is ClassID and my outputs are student names and grades. Itried this below but keep getting error.</p>
  
  <pre><code>CREATE DEFINER=`root`@`localhost` PROCEDURE `totalAssignmentGradesbyCourse`(aAssignment     dec)
  SELECT (ClassID) AVG('Assignment1', 'Assignment2',Assignment 3)
  FROM student_classes sc
  INNER JOIN LastNames, ClassID
  ON sc.student_classes
  WHERE Assignment=aAssignment
  GROUP BY Assignment;
  END
  </code></pre>
  
  <p>fields for Table student_classes:</p>
  
  <pre><code>INSERT INTO student_classes
  VALUES (NULL, 45, 36, '2012-01-01', '90', '100', '80', '90', '3.0');
  
  SELECT * FROM student_classes;
  
  INSERT INTO student_classes
  VALUES (NULL, 46, 37, '2012-05-01', '60', '70', '80', '90', '2.7');
  
  SELECT * FROM student_classes;
  
  INSERT INTO student_classes
  VALUES (NULL, 47, 38, '2012-08-01', '100', '100', '100', '95', '4.0');
  
  SELECT * FROM student_classes;
  
  INSERT INTO student_classes
  VALUES (NULL, 48, 39, '2012-01-01', '85', '90', '80', '92', '3.5');
  
  SELECT * FROM student_classes;
  
  student_classes Table Columns:StudentClassID, StudentID, ClassID, StartDate, Assignment1, Assignment2, Assignment3,Assignment4, ClassGPA.
  </code></pre>
  
  <p>I'm confused.</p>