Question: Could someone show me how to write SQL insert, delete, update, and get stored procedure statements for the following table (Quarantined), using the examples below.
Could someone show me how to write SQL insert, delete, update, and get stored procedure statements for the following table (Quarantined), using the examples below. I've been trying and am not getting anywhere. Your help is greatly appreciated as I am getting frustrated with this.
Quarantined Table To Write Stored Procedures For:

Stored Procedure Examples To Follow Provided By Instructor:

as Primary Key */ /* Create Quarantined Table */ CREATE TABLE Quarantined ( Status ID INT NOT NULL, /* Foreign Key on Status Table which also serves Start_Date DATE NOT NULL, End Date DATE NOT NULL, Location_ID INT NOT NULL, /* Foreign Key on Location Table */ CONSTRAINT Quarantined_PK PRIMARY KEY (Status_ID), CONSTRAINT Quarantined_Status_FK FOREIGN KEY (Status_ID) REFERENCES Status(Status_ID), CONSTRAINT Quarantined_Location_FK FOREIGN KEY (Location_ID) REFERENCES Location(Location_ID) # Insert new group into groups table CREATE PROCEDURE 'dmcs'.insert Group' (IN v_group_name VARCHAR (45), IN v_group_desc VARCHAR(100), v_group_leader VARCHAR(45), IN v_group_specialization VARCHAR(45) 7 BEGIN INSERT INTO GROUPS (group_name, group_desc, group_leader, group_specialization) VALUES (v_group_name, v_group_desc, V_group_leader, v_group_specialization); END # DELETE group based on group_id CREATE PROCEDURE 'dmcs. deleteGroup' (IN v_group_id INT(11)) BEGIN DELETE FROM GROUPS WHERE group_id = v_group_id; END # UPDATE change in group leader based on group_id CREATE PROCEDURE 'dmcs. updateGroup' (IN v_group_id INT (11), IN V_group_leader VARCHAR (45)) BEGIN UPDATE GROUPS SET group_leader = v_group_leader WHERE group_id = V_group_id; END # GET group name, group leader, group desc based on group_id CREATE PROCEDURE cmcs.getGroup' (IN v_group_id(11) ) BEGIN SELECT groups.group_name, groups.group_desc, groups.group_id, person person_id, person. person_name FROM GROUPS, PERSON WHERE groups.group_leader = person. person_id AND group_id = '_grp_id; END
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
