# Db2 sql pl basic arithmetic procedure in power systems.

You have been asked to create and test two DB2 procedures: one that implements basic arithmetic operations, and another that retrieves data from a specific table. You will develop a version of each procedure for both the Power Systems and System-z environments.

Upon the completion of this lab, students will have hands-on experience coding SQL PL Procedures in DB2 on multiple platforms.

Deliverables:

Lab Steps

Step 1    DB2 SQL PL Basic Arithmetic Procedure in Power Systems             15 points

Step 2    DB2 SQL PL Basic Arithmetic Procedure in System z           15 points

Step 3    Retrieving data from Student Registration Database in Power Systems    15 points

Step 4    Retrieving data from Student Registration Database in System z  15 points

Total Lab Points 60 points

You should submit to the Dropbox a Word document containing:

SQL PL code for each task

Screenshots of the output from each task (Each screenshot immediately follows the associated code).

iLab Steps

Step 1: SQL PL Basic Arithmetic Procedure

Code a PL/SQL script that will output three variables containing messages. To produce these messages, your procedure should initialize three variables with the values 45, 72, and 6.3. These values will be used to create messages as follows.

The first message will report the result of adding the first two numbers (45 and 72) and then multiplying their sum by the third number (6.3). Format the message as:

The result of (first_num + second_num) * third_num equals tot_val.

An example message, formed using different numbers but following the same approach, would look like this:

The result of (2 + 3) * 4 equals 20

The second message will be constructed in a similar manner, except that now the first number (45) is added to the product of the last two numbers (72 and 6.3). Format the second message as:

The result of first_num + second_num * third_num equals tot_val.

An example message, formed using different numbers but following the same approach, would look like this:

The result of 2 + 3 * 4 equals 14.

The third message should state:

The difference is due to the “Order of Operations.”

Sample output:

Lab01_Tsk01 Output:

The result of (2 + 3) * 4 equals 20

The result of 2 + 3 * 4 equals 14

The difference is due to the “Order of Operations.”

The result of 2+3*4 equals 14

The difference is due to the “Order of Precedence”.

Step 2: Retrieving data from Student Registration Database

This requires use of the Student Registration Database and the columns in the Student Table.

Code a SQL PL procedure that will accept a student id as an input parameter and then retrieve the student’s first name, last name, employer, and phone number. This information will be packaged into a message that gets returned from the procedure as an output parameter. The message will be formatted as follows:

[first_name] [last_name] works at [employer] and can be reached at [phone].

For example:

Joe Blowe works at FedEx and can be reached at (773) 555-1212.

However, if the student id entered cannot be found in the table, your output message should be as follows::

The student id n does not exist.

For example:

The student id, 999, does not exist.

Execute the script four times, using the following values: 130, 200, 310, and 909. The last value should result in the message stating that the student id does not exist. (This is a function of the data in the Student table – do not hard-code any specific values in your procedure).

Basic features
• Free title page and bibliography
• Unlimited revisions
• Plagiarism-free guarantee
• Money-back guarantee
On-demand options
• Writer’s samples
• Part-by-part delivery
• Overnight delivery
• Copies of used sources
Paper format
• 275 words per page
• 12 pt Arial/Times New Roman
• Double line spacing
• Any citation style (APA, MLA, Chicago/Turabian, Harvard)

# Our guarantees

We value our customers and so we ensure that what we do is 100% original..
With us you are guaranteed of quality work done by our qualified experts.Your information and everything that you do with us is kept completely confidential.

### Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

### Zero-plagiarism guarantee

The Product ordered is guaranteed to be original. Orders are checked by the most advanced anti-plagiarism software in the market to assure that the Product is 100% original. The Company has a zero tolerance policy for plagiarism.

### Free-revision policy

The Free Revision policy is a courtesy service that the Company provides to help ensure Customer’s total satisfaction with the completed Order. To receive free revision the Company requires that the Customer provide the request within fourteen (14) days from the first completion date and within a period of thirty (30) days for dissertations.

The Company is committed to protect the privacy of the Customer and it will never resell or share any of Customer’s personal information, including credit card data, with any third party. All the online transactions are processed through the secure and reliable online payment systems.

### Fair-cooperation guarantee

By placing an order with us, you agree to the service we provide. We will endear to do all that it takes to deliver a comprehensive paper as per your requirements. We also count on your cooperation to ensure that we deliver on this mandate.

## Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
\$26
The price is based on these factors: