Question: Given the SIS database, write a stored procedure, called spINFO, that takes two input parameters: the DeptID and the CrsID. If the user enters the

Given the SIS database, write a stored procedure, called spINFO, that takes two input parameters: the DeptID and the CrsID. If the user enters the DeptID and the CrsID, the stored procedure returns the number of students who are in that department enrolling in that course.

After creating the stored procedure, execute it and then print the value returned by the stored procedure by showing the following sentence:

Number of students is:

Hint: don't print the returned value inside the stored procedure.

DB:

create table Student( StdID int primary key, Name varchar(20), Proficiency int, Payment varchar(3), DeptID varchar(10) );

create table Department( DeptID varchar(10) primary key, DeptName varchar(50), );

create table Enrollment( StdID int, CrsID varchar(20), Grade int, primary key(StdID,CrsID) );

create table Course( CrsID varchar(20) primary key, CrsName varchar(50), ); ------------------------------------- insert into Student values (1,'John',75,'yes','EE'), (2,'Kathy',92,'no','HIST'), (3,'Chris',72,'yes','HIST'), (4,'John',98,'no','EE') ------------------------------------ insert into Department values ('EE','Electrical Engineering'), ('HIST','History'), ('CLIS','Information Studies') ------------------------------------ insert into Enrollment values (1,'lbsc690',90), (1,'ee750',95), (2,'lbsc690',80), (2,'hist405',60), (3,'hist405',75), (4,'ee600',70) ----------------------------------- insert into Course values ('lbsc690','Information Technology'), ('ee750','Communication'), ('hist405','American History')

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!