Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help with the two problems below, I have also included the table necessary to complete the questions. CREATE TABLE ProductTable( ProductID INTEGER NOT

I need help with the two problems below, I have also included the table necessary to complete the questions.

CREATE TABLE ProductTable(

ProductID INTEGER NOT NULL primary key,

ProductName VARCHAR(50) NOT NULL,

ListPrice NUMBER(10,2),

Category INTEGER NOT NULL

);

/

INSERT INTO ProductTable VALUES(299,'Chest',99.99,10);

INSERT INTO ProductTable VALUES(300,'Wave Cruiser',49.99,11);

INSERT INTO ProductTable VALUES(301,'Megaland Play Tent',59.99,11);

INSERT INTO ProductTable VALUES(302,'Wind-Up Water Swimmers',2.00,11);

INSERT INTO ProductTable VALUES(303,'Garmin Pocket or Vehicle GPS Navigator',609.99,12);

  1. (3 points for code and screenshots of testing your code) Write a functionf_concatenate_strings that will do the same as concatenate_strings procedure from #1, but can be called from a select statement. Examples of output:

SELECT f_concatenate_strings('Crypto','Currency') FROM DUAL;

Will return CryptoCurrency Date: 06-JAN-18 user: speltsve

SELECT f_concatenate_strings(ProductName, to_char(ListPrice, '$999.99')) from ProductTable WHERE ProductID=302;

First, the table ProductTable, then product with ID 302 will be located. Product name of that product will be concatenated with the price and current date.

Will return Wind-Up Water Swimmers $2.00 06-JAN-18 user: speltsve

Provide code and screenshot showing successful execution and results. You have to provide at least two test cases.

  1. (4 points for code and screenshots) Create a procedure that accepts product ID as a parameter and returns the name of the product from ProductTabletable. Add exception handling to catch if product ID is not in the table.

Use ProductTablecreated earlier in the module.

Provide code and screenshot showing successful execution and results. You have to provide at least two test cases.

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

Step: 3

blur-text-image

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

OCA Oracle Database SQL Exam Guide Exam 1Z0-071

Authors: Steve O'Hearn

1st Edition

1259585492, 978-1259585494

More Books

Students also viewed these Databases questions