Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design Application And Administration

Authors: Michael Mannino, Michael V. Mannino

2nd Edition

0072880678, 9780072880670

More Books

Students also viewed these Databases questions