Question: table [ [ Customer , Order ] , [ CustomeriD , FirstName,LastName,Email,City,Onderib,Customento,Orderbate,totalPrice ] , [ 1 , Avined,N , ahned.aliaemal com,Ramallah, 1 , 1

\table[[Customer,Order],[CustomeriD,FirstName,LastName,Email,City,Onderib,Customento,Orderbate,totalPrice],[1,Avined,N,ahned.aliaemal com,Ramallah,1,1,2023-01-01,30.37],[2,Fatima,Whan,tatima khangemall com,Bethlehem,2,2,2023-02-15,0.99],[3,Omx,Abdullah,omar abdulah Eemail com,Joricho,3,3,2023-03-10,42.82],[4,Laytin,Ahenad,layla ahmade emal.com,Nablus,4,4,2023-04-20,15.07],[5,Nada,Hassan,nada hasas femail.com,Hebron,5,5,2023-05-05,6.15],[6,Whated,Amin,Khalid amin Bremail com,Gaza,,,,],[7,Hars,Sadiq,hare sadiq e emall com,Jenin,,,,],[-,Karim,Rahman,karim rahman teemal oom,Tulkarm,,,,],[e,Aishe,Hamid,aisha hamidelemal com,Bethlehem,,,i,],[10,Yountert,Fawal,yousset fawei femalicom,Ramallah,,,,]]
\table[[OrderLine],[OrderDetailio OrderiD,ProductiD,Quantity,Price,],[1,1,1,2,3.93],[2,1,3,3,7.47],[3,2,2,1,0.99],[4,3,4,5,3.95],[5,3,5,2,2.58],[6,3,6,3,5.97],[7,4,1,2,3.98],[8,4,4,3,2.37],[9,5,2,1,0.99],[10,5,5,2,2.58]]
Given the data above write SQL queries to answer the following questions:
Print the ids of orders which contain at least one product of category fruit.
Print ids of orders which contain items of two different categories.
 \table[[Customer,Order],[CustomeriD,FirstName,LastName,Email,City,Onderib,Customento,Orderbate,totalPrice],[1,Avined,N,ahned.aliaemal com,Ramallah,1,1,2023-01-01,30.37],[2,Fatima,Whan,tatima khangemall com,Bethlehem,2,2,2023-02-15,0.99],[3,Omx,Abdullah,omar abdulah Eemail com,Joricho,3,3,2023-03-10,42.82],[4,Laytin,Ahenad,layla ahmade emal.com,Nablus,4,4,2023-04-20,15.07],[5,Nada,Hassan,nada hasas femail.com,Hebron,5,5,2023-05-05,6.15],[6,Whated,Amin,Khalid

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!