Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Given the database table below, write a stored procedure called SP GetBCStationl

ID: 3807268 • Letter: G

Question

Given the database table below, write a stored procedure called SP GetBCStationlnfo. This stored procedure will accept a single argument that represents the format field. The stored procedure will get all information from the table below based on this parameter and order the data by 'city'. You will create this stored procedure in a text file that can be run using the MySQL 'source' command. Write the Stored Procedure below: Show an example how this stored procedure would be called using the MySQL command line interface:

Explanation / Answer

Please find the below my sql script, you have to just copy and paste in query window of mysql and execute it.

use broadcast_info;

--- To create procedure named as 'SP_GetBCStationInfo'
    CREATE PROCEDURE SP_GetBCStationInfo( IN format_para VARCHAR(25))
    BEGIN
         Select
           call_sign,
           stations,
           city,
           format
       From Fn_stations
       Where format = format_para;
    END  

--- To execute procedure
mysql> CALL SP_GetBCStationInfo('10')

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote