Question: Please write a stored function named fHW _ 7 _ xxxx ( ) which will take two inputs ( type , keyword ) . a

Please write a stored function named fHW_7_xxxx() which will take two inputs (type, keyword).
a. The keyword is a substring used to search the course name. You must use LIKE for the pattern match.
b. If the type is not 1 or 2, return an error message Please input a valid type.
c. If the keyword is empty or null, return an error message Please input a valid keyword.
d. If there is no course name contains the keyword, return No course found that contains keyword: zzz. where zzz
is the input keyword.
e. If type is 1, return all course ID: course name that course name contains the keyword.
f. If type is 2, return all course ID: student ID who took the courses that course name contains the keyword.
g. The return should be in one line and your report format must match the test cases.
h. You need to use group_concat() function to merge multiple rows output into one line.
i. Please refer to Students, Courses, Students_Courses tables in the dreamhome database.

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 Databases Questions!