Week005-Select-LabExer002 Rivera Dennis
Week005-Select-LabExer002 Rivera Dennis
Direction:
Copy and paste the PARTS table
Copy and paste the PL/SQL code on the space provided after each questions.
Table Name: PARTS
PARTNUM DESCRIPTION ONHAND CLASS WAREHOUSE PRICE
AT94 IRON 50 HW 3 2495
BVO6 HOME GYM 45 SG 2 79495
CD52 MICROWAVE OVEN 32 AP 1 165
DL71 CORDLESS DRILL 21 HW 3 12995
DR93 GAS RANGE 8 AP 2 495
DW11 WASHER 12 AP 3 399
FD21 STAND MIXER 22 HW 3 159
KL62 DRYER 12 AP 1 349
KT03 DISHWASHER 8 AP 3 595
KV29 TREADMILL 9 SG 2 1390
PARTS structure
COLUMN NAME DATA TYPE/SIZE KEY NULL
PARTNUM CHAR – 4 PRIMARY NOT NULL
DESCRIPTION VARCHAR – 20 NOT NULL
ONHAND NUMBER – 6
CLASS CHAR – 5
WAREHOUSE NUMBER – 6
PRICE NUMBER – 6
3. Create a report specifying only the column PRICE, ONHAND and DESCRIPTION.
4. Create a report that will add 10% increase in PRICE. List only the column DESCRIPTION, CLASS and
PRICE.
5. Create a report that will deduct 5 from ONHAND, multiply 5 in WAREHOUSE, after getting the value
on both ONHAND and WAREHOUSE add their data: as shown below:
ONHAND - 5 + 5 * WAREHOUSE
Note that you have to force the Oracle to prioritize first the Subtraction over Multiplication. List only the
column DESCRIPTION, ONHAND and WAREHOUSE.
6. Create a report that will rename the column DESCRIPTION to TITLE, PARTNUM to ID and
ONHAND to STOCK.
7. Create a report the will merge the column CLASS and PRICE rename the COLUMN as “CLASS
PRICE”.
8. Create a report that will combine the column PARTNUM and DESCRIPTION put a literal character
string “belongs to” in between the two columns then rename the column as “NUMBER TITLE”. Note
put space before and after the character literal string to avoid no spaces in the report.
9. Create a report that will display the unique value for WAREHOUSE rename the column as “No. of
Available Warehouse”.
10. What is the help of SELECT statement? Is there any permanent made in the database once the user uses
different SELECT.
SELECT statement can help to select data from a database and it can help to specify the columns
in database tables that can include in the result. NO.