Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

General Instructions Log into your online Oracle SQL account (if you\'ve not cre

ID: 328189 • Letter: G

Question

General Instructions

Log into your online Oracle SQL account (if you've not created an account yet, please create one) at livesql.oracle.com

Download the Saleco.sql script from Canvas and then upload it into the "My Scripts" folder in your livesql.oracle.com account.

Run the script to create tables for the hardware store database, examples of which are discussed in Chapter 7 of the textbook and Chapter 7 slides.

Write and run an SQL query in "SQL Worksheet" in your livesql.oracle.com account for the problem described below.

Debug (i.e., fix any errors that you may have). Then create a single screenshot showing your SQL statement and its output.

Paste the screenshot in a blank Microsoft Word document, write your name at the top of this document, and submit it through Canvas Assignments link.

Problem Description

Write and run an SQL statement to display product code, product description, base price, and discounted price of all different kinds of saws (i.e., those products whose description contains the word "saw") whose quantity on hand (p_qoh) is 8 or more.

Please note the following:

(1) Column headings (captions) should be displayed as shown in the following partial output. (2) Base price is the price currently listed in the p_price column of products table. (3) Discounted price is the price after applying the discount listed in the P_DISCOUNT column in the product table. Discount rate is listed in percentage - for example 5% discount is listed as .05, 12% as .12 etc. (4) Output is sorted by the p_price (Base Price) column from the highest price to the lowest price. (5) Discounted price is rounded to two decimal places (using the ROUND function).

Partial output of this query looks like the one below. However, this is only a partial output – for your homework, please include complete SQL statement and its complete output in a single screenshot.

CUSTOMER INVOICE CUS_cODE CUS LNAME CUS FNAME CUS INITIAL CUS AREACODE CUS PHONE CUS BALANCE INV NUMBER CUS CODE INV DATE INV NUMBER LINE NUMBER P CODE LINE UNITS LINE PRICIE PRODUCT P CODE P DESCRIPT P INDATE VENDOR 0 v CODE V NAME V CONTACT V AREACODE V PHONE V STATE V.ORDER P.QOH P MIN P PRICE P DISCOUNT V.ODE

Explanation / Answer

Select PRODUCT.P_CODE as Product#, PRODUCT.P_DESCRIPT as Product Name, round (PRODUCT.P_PRICE, 2) as Base Price, PRODUCT.P_PRICE * PRODUCT.P_DISCOUNT as round (Discounted Price, 2) from PRODUCT where PRODUCT.P_DESCRIPT like '%saw%'