01.09.2016 Views

Beginning Oracle Database 11g Administration From Novice to Professional

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

CHAPTER 2 SQL AND PL/SQL 43<br />

Suppliers Who Supply at Least One Part That Is Not Supplied by a Specified Supplier<br />

Notice the inline view that occurs in Listing 2-24. Also notice the use of the keyword <br />

—it is required because SQL does not au<strong>to</strong>matically eliminate duplicates. The in<br />

indicate that is a variable element. <strong>Oracle</strong> will request a value<br />

for when you execute this statement.<br />

Listing 2-24. Suppliers Who Supply at Least One Part That Is Not Supplied by a Specified<br />

Supplier<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

<br />

Suppliers Who Do Not Supply at Least One Part That Is Supplied by a Specified Supplier<br />

The answer <strong>to</strong> this problem is similar <strong>to</strong> the answer <strong>to</strong> the previous problem. All that<br />

changes is the order in which one table is subtracted from the other, as shown in<br />

Listing 2-25. Notice that we have <strong>to</strong> once again use the keyword <strong>to</strong> eliminate<br />

duplicates.<br />

Listing 2-25. Suppliers Who Do Not Supply at Least One Part That Is Supplied by a Specified<br />

Supplier

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!