Hi, please look at this oracle database assigment and point me in the right dire
ID: 3883089 • Letter: H
Question
Hi, please look at this oracle database assigment and point me in the right direction.
This is what I have to do:
Run SQL*Plus iggy/oracle. (It is assumed that you have already run the LoadDB.sql script last week that built the required user and tables (yes did that .) Type SPOOL c:cis421bS3spool.txt .
Write a single SQL statement that lists all suppliers supplying only hammers using the difference operation.
When finished, stop the spooling and exit the program.
This is my data:
SQL> DESCRIBE iggy.part;
Name Null? Type
----------------------------------------- -------- ----------------------------
PARTNAME NOT NULL VARCHAR2(32)
SQL> SELECT * FROM iggy.part;
PARTNAME
--------------------------------
HAMMER
NAIL
SQL> DESCRIBE iggy.supplier;
Name Null? Type
----------------------------------------- -------- ----------------------------
SUPPLIERNAME NOT NULL VARCHAR2(32)
SQL> SELECT * FROM iggy.supplier;
SUPPLIERNAME
--------------------------------
NEW YANKEE WORKSHOP, INC.
OLD YANKEE WORKSHOP, INC.
TOOL TIME, INC.
SQL> DESCRIBE iggy.quote;
Name Null? Type
----------------------------------------- -------- ----------------------------
SUPPLIERNAME NOT NULL VARCHAR2(32)
PARTNAME NOT NULL VARCHAR2(32)
QUOTE NOT NULL NUMBER(8,2)
SQL> SELECT * FROM iggy.quote;
SUPPLIERNAME PARTNAME QUOTE
-------------------------------- -------------------------------- ----------
NEW YANKEE WORKSHOP, INC. HAMMER 1.89
NEW YANKEE WORKSHOP, INC. NAIL .19
OLD YANKEE WORKSHOP, INC. HAMMER 2.09
TOOL TIME, INC. HAMMER 1.99
TOOL TIME, INC. NAIL .2
SQL> SPOOL OFF;
Appriciate the help!!
Explanation / Answer
Ans:
we will get first all the suppliers from those we will take off others(by difference operation) then we will get only suppliers supplying only hammers.
-->
select SUPPLIERNAME from iggy.quote - select SUPPLIERNAME from iggy.quote where PARTNAME=NAIL;
we have two part name so if we take off NAIL we will get HAMMER suppliers names.
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.