Question: Write a stored function named fHW _ 9 _ xxxx ( student _ id , year ) that calculates and returns the total tuition fees
Write a stored function named fHWxxxxstudentid year that calculates and returns the total tuition fees a student has incurred for a specific year based on their enrolled courses. The function should meet the following requirements
Case
If the studentid is negative or NULL, return an error message Please enter a valid studentid select fHWxxxxnull as output; select fHWxxxx as output;
case
If the year is negative or NULL, return an error message Please enter a valid year. select fHWxxxx null as output; select fHWxxxx as output;
Case
If both the studentid and year are return the message with the total payment for all students across all years and semesters. select fHWxxxx as output;
Case
If the studentid is not in the system, regardless of whether the year is or a specific year, return the message: 'Studentid zzzz is not in the system. select fHWxxxx as output;
case
If studentid is in the system and the year is return the message with total payment for the given studentid across all years. select fHWxxxx as output;
Case
If studentid is in the system and the year is return the message with the payment for the given studentid for each year. select fHWxxxx as output;
Case
If the studentid is or in the system and year is NOT in the system, return the message: No student founds for year yyyy is in the system'. select fHWxxxx as output;
Case
If the studentid is and year is the system, return the total payment for the given year across all students. select fHWxxxx as output;
Case
If the studentid is and year is is in the system, return the message with the total payment for the given year for each student. select fHWxxxx as output;
Case
If the studentid and year are is in the system, but studentid not enrolled in the give year, return the message Student ID: zzzz not enrolled in year yyyy select fHWxxxx as output;
Case
If the studentid and year are is in the system and studentid enrolled in the give year, return the message with the total payment for the given studentid and year. select fHWxxxx as output;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
