Question: Please write a stored procedure named pHW _ 6 _ xxxx ( student ) which will display the student s transcript by the input (

Please write a stored procedure named pHW_6_xxxx( student ) which will display the students transcript by the input (semester, year).Your program needs to meet the following requirements and test cases.
a. If the input year is *, the report should have all students for all years.
b. If the input semester is *, the report should have all the terms in that year.
c. If the input semester or year is empty or null, a corresponding error message should be printed.
d. If there is no student for the input semester/year, the output message should say year xxxx, semester zzzz has no students in the system.
e. If there are students found for the input semester/year, print the report with the format based on the test cases.
f. The report should be sorted by the students last name, first_name from A to Z, year from low to high, semester from spring to fall.
g. Please refer to Students, Courses, Students_Courses tables that is within the CPS3740_2024S database.
i. Please keep the sql simple and no hard coding!
6.1 Data entry validation for year.
> call pHW_6_demo('','');
> call pHW_6_demo('Fall', null);
6.2 Data entry validation for semester.
> call pHW_6_demo('',2012);
> call pHW_6_demo(null,2012);
6.3 The message when no students are found.
> call pHW_6_demo('*',2030);
> call pHW_6_demo('Spring',2013);
6.4 A report shows students for a specific semester and year.
> call pHW_6_demo('Fall',2014);
6.5 A report shows the students for all semesters in a specific year.
> call pHW_6_demo('*',2014);
6.6 A report shows all students for all semesters and years.
> call pHW_6_demo('*','*');
Here is the information stored in the Students table within the dreamhome database
'1007', 'Sarah', 'Lee', '1995-09-15','IT','04101'
'1005', 'Helen', 'Wu','1997-01-25','CS','07083'
'1004', 'Andrew', 'Lin', '1947-08-25', 'Biology', '07101'
'1003', 'Claudia', 'Lee', '1987-03-21', 'Math', '91384'
'1002', 'Mary', 'Smith', '1976-02-08','IT','08348'
'1001', 'Austin', 'Huang', '1990-01-01','CS','07123'
This is describing the Courses table;
Field, Type, Null, Key, Default, Extra
'course_name','varchar(100)','YES','',NULL,''
'course_id','int(11)','NO','PRI',NULL,''
'course_code','varchar(20)','YES','',NULL,''
This is what is stored in the Courses table;
course_id, course_code, course_name
'1','CPS2231','Java2'
'2','CPS2232','Data Structure'
'3','CPS3500','Web Programming'
'4','CPS3740','Database Introduction'
'5','CPS5920','Database Systems'
'6','CPS5921','Data Mining'
This is describing the Students_Courses table;
Field, Type, Null, Key, Default, Extra
'student_id','int(11)','NO','PRI','0',''
'course_id','int(11)','NO','PRI','0',''
'semester','varchar(20)','YES','',NULL,''
'year','varchar(10)','YES','',NULL,''
'grade','varchar(5)','YES','',NULL,''
This is what is stored in the Students_Courses table;
Student_id, course_id, semester, year, grade
null, null, null, null
This is describing the Students table;
Field, Type, Null, Key, Default, Extra
'student_id','int(11)','NO','PRI',NULL,''
'first_name','varchar(50)','YES','',NULL,''
'last_name','varchar(50)','YES','',NULL,''
This is what is stored in the Students table;
Student_id, first_name, last_name
'1','Austin','Huang'
'2','Claudia','Lee'
'3','Sarah','Lee'
'4','Andrew','Lin'
'5','Helen','Wu'
The screenshot consist of the outputs that should be executed.
Please write a stored procedure named pHW _ 6 _

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!