3.Write a SQL statement to create a stored procedure called Calc_Average based on the Semester_Marks table created in Table 2: Semester_Marks table structure. The stored procedure should update the total marks, no of courses and calculate the average mark for each student. (Note: Average mark = total_mark divide by the number of courses for the student.).
3.Write a SQL statement to create a stored procedure called Calc_Average based on the Semester_Marks table created in Table 2:
Semester_Marks table structure.
The stored procedure should update the total marks, no of courses and calculate the average mark for each student.
(Note: Average mark = total_mark divide by the number of courses for the student.).
Control the flow of your code should an error occur (e.g. number of courses enter is zero). Use exception handling to avoid zero being
entered for the number of courses.
4.Write a statement to create a procedure which accepts a discount as input. The procedure should have two conditions. Firstly, if the
discount is between 1 to 15 percent, the base amount should be increased with 1000 and the increased value is printed, secondly if
the discount is between 16 to 30 percent the base amount should be decreased with 500 and the decreased value is printed. Write a
statement to invoke the procedure.
Step by step
Solved in 2 steps