Question: Given the following table ( called Orders ) , what would be the SQL for finding the order numbers of the orders that include BOTH

Given the following table (called Orders), what would be the SQL for finding the order numbers of the orders that include BOTH items 101 and 102?
The orders table is structured Orders(orderno, itemno, quantity) with the following rows:
(O1,101,3)
(O2,102,5)
(O2,101,7)
(O2,103,5)
(O3,101,1)
(O4,101,2)
(O4,102,3)
select distinct orderno from Orders where itemno=101 or iteno =102
select distinct orderno from Orders where itemno =101 and itemno =102
select distinct orderno from Orders where itemno in (101,102)
select orderno from Orders where itemno =101
intersect select orderno from Orders where itemno =102
 Given the following table (called Orders), what would be the SQL

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!