Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

(a) (2 marks) Name the two different types of variables that have been used in the above stored procedure. Describe these variable types with one

image text in transcribed

(a) (2 marks) Name the two different types of variables that have been used in the above stored procedure. Describe these variable types with one characteristic each.

(b) (3 marks) Discuss all the error conditions that you may come across as a result of the execution of the procedure. Add an appropriate error handler to the procedure in order to handle such errors.

(c) (2 marks) Create a MySQL procedure that takes department ID as an input and prints the details of all the students including Student ID, name, and the description of the major that they are currently enrolled in.

You may use the following procedure template: CREATE PROCEDURE Student_Major (IN I_deptID INT)

BEGIN . . .

END

QUESTION B1. This question assumes the following relational schema: (7 marks) Student (StudentID, Lname, Fname, Address, BirthDate, Phone, MajorID, DeptID ) Primary Key: StudentID Foreign key: MajorID refers to MajorID in Major Major (MajorID, MajorDesc) Primary Key: MajorID You have been given the following stored MySQL procedure: CREATE PROCEDURE StudentBirthDate (IN V_DOB DATE) BEGIN DECLARE V_SID INT; DECLARE V_NAME VARCHAR (60) SELECT StudentID, CONCAT(Fname, ' FROM Student WHERE BirthDate - V_DOB; % name INTO V-SID, V-NAME END

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 Principles Programming And Performance

Authors: Patrick O'Neil, Elizabeth O'Neil

2nd Edition

1558605800, 978-1558605800

Students also viewed these Databases questions

Question

4 Use a model to analyze various government policies

Answered: 1 week ago

Question

Define text analytics.

Answered: 1 week ago

Question

Detailed note on the contributions of F.W.Taylor

Answered: 1 week ago

Question

3. Is IBMs program really a mentoring program? Why or why not?

Answered: 1 week ago