Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a query to retrieve all products that had been ordered by customer id = 2. The SQL query should show order id, order date
Write a query to retrieve all products that had been ordered by customer id = 2. The SQL query should show order id, order date (from Orders table) , product ID, and product name (from Products table). Sort the results by orderdate with ascending order so that the older appear first.
ProductID | ProductName | SupplierID | QuantityPerUnit | ProductUnitPrice | UnitsInStock | UnitsOnOrder | ReorderLevel | SKU | Active |
1 | Almonds, Hickory Smoked - 12 oz. Bag | 1 | 12 | 35 | 40 | 5 | 45 | PDKLS-2332 | TRUE |
2 | Almonds, Roasted and Salted - 18 oz. Bag | 1 | 12 | 22 | 32 | 0 | 20 | PDKLSD-2344 | TRUE |
3 | Banana Chips - 20 oz. Bag | 1 | 12 | 27 | 25 | 0 | 20 | PDKLSD-2347 | TRUE |
4 | Berry Cherry in 8 oz. Bag | 1 | 15 | 30 | 50 | 0 | 30 | PDK-2589 | TRUE |
5 | California Original Pistachios - 1 lb. Bag | 1 | 15 | 29 | 35 | 0 | 30 | PDK-2347 | TRUE |
6 | Choice Apricots - 16 oz. Bag | 1 | 25 | 32 | 22 | 0 | 25 | PDKLS-2347 | TRUE |
7 | Cran Raisin Mix in 17 oz. Bag | 1 | 12 | 31 | 24 | 0 | 25 | PDKLS-2347 | TRUE |
8 | Dried Blueberries - 1 lb. Bag | 1 | 10 | 28 | 28 | 0 | 30 | PDKLS-2347 | TRUE |
9 | Dried Cranberries - 34 oz. | 1 | 15 | 35 | 15 | 10 | 20 | PDKLS-2347 | FALSE |
10 | Raw Sunflower Seeds in 19 oz. Bag | 1 | 25 | 25 | 12 | 15 | 20 | PDKLS-2347 | TRUE |
11 | Cappuccino Almonds in 8oz. Bag | 2 | 30 | 35 | 32 | 0 | 30 | PDKLS-2347 | FALSE |
12 | Chocolate Covered Cherries in 8 oz. Bag | 2 | 35 | 37 | 42 | 0 | 40 | PDKLS-2347 | TRUE |
13 | Chocolate Blueberries in 10 oz. Bag | 2 | 25 | 29 | 39 | 0 | 30 | PDKLS-2347 | TRUE |
14 | Chocolate Fudge | 2 | 28 | 41 | 31 | 0 | 30 | DKLS-4732 | TRUE |
15 | Chocolate Blueberries in 10 oz. Bag | 2 | 28 | 24 | 28 | 0 | 25 | DKLS-4732 | FALSE |
16 | Chocolate Almonds in 8 oz. Bag | 2 | 25 | 25 | 21 | 0 | 25 | DKLS-4732 | FALSE |
17 | Dark Chocolate Apricots in 20 oz. Bag | 2 | 35 | 46 | 38 | 0 | 25 | DKLS-4732 | TRUE |
18 | Sesame Crackers in 20 oz. Pack | 2 | 25 | 39 | 43 | 0 | 35 | DKLS-4732 | FALSE |
19 | Crispy Pears | 2 | 20 | 33 | 31 | 0 | 35 | DKLS-4732 | TRUE |
20 | Chunky Pretzels | 3 | 30 | 22 | 43 | 0 | 45 | DKLS-4732 | TRUE |
21 | Chocolate Coconut Bar | 3 | 15 | 26 | 37 | 0 | 45 | PDKL-2389 | FALSE |
22 | Roasted & Salted Almonds | 3 | 35 | 19 | 35 | 0 | 45 | PDKL-2389 | FALSE |
23 | Roasted & Salted Cashews | 3 | 26 | 30 | 22 | 15 | 25 | PDKL-2389 | TRUE |
24 | Roasted No-Salt Almonds | 3 | 28 | 39 | 38 | 10 | 35 | PDKL-2389 | TRUE |
25 | Water Crackers 4.4 oz. | 3 | 32 | 24 | 44 | 0 | 20 | PDKL-2389 | TRUE |
26 | Nacho Chips Bag | 3 | 28 | 25 | 24 | 25 | 35 | PDKL-2389 | TRUE |
27 | Corn Chips Bag | 4 | 32 | 37 | 24 | 10 | 30 | PDKL-2389 | TRUE |
28 | Pepper Cheese Box 3.75 oz. | 4 | 22 | 50 | 45 | 0 | 30 | PDKL-2389 | TRUE |
29 | Chocolate Truffle Cookies | 4 | 30 | 24 | 41 | 0 | 30 | PDKL-2389 | TRUE |
30 | Traditional Swedish Cookies, 5.25 oz. | 4 | 20 | 25 | 41 | 0 | 45 | PDKL-2389 | TRUE |
31 | Chocolate Chunk Cookies, 9.5 oz. | 4 | 34 | 48 | 15 | 20 | 40 | ASDT-3456 | TRUE |
32 | Peanut Butter Creme Cookies, 9.6 oz. | 4 | 20 | 18 | 37 | 10 | 40 | ASDT-3456 | TRUE |
33 | Cinnamon Flavor Cookies 27 oz. | 5 | 28 | 24 | 41 | 0 | 35 | ASDT-3456 | TRUE |
34 | Coconut Flavour Cream Wafers 10 oz. | 5 | 35 | 38 | 27 | 10 | 30 | ASDT-3456 | TRUE |
35 | Coffee biscuits | 5 | 30 | 50 | 24 | 0 | 35 | ASDT-3456 | TRUE |
36 | Lemon Biscuits | 5 | 30 | 48 | 45 | 0 | 25 | ASDT-3456 | TRUE |
37 | Cream and honey biscuits | 5 | 28 | 22 | 22 | 0 | 20 | ASDT-3456 | TRUE |
38 | Cocoa and Hazelnut Biscuits | 5 | 25 | 35 | 42 | 0 | 35 | ASDT-3456 | TRUE |
39 | Pizza croutons | 5 | 20 | 49 | 44 | 0 | 25 | ASDT-3456 | TRUE |
40 | Biscuits with cream | 5 | 25 | 27 | 49 | 0 | 25 | ASDT-3456 | TRUE |
41 | Banana Bisquits | 6 | 30 | 38 | 38 | 0 | 30 | ADSE 2345 | TRUE |
42 | Chocolate Bisquits | 6 | 30 | 19 | 36 | 0 | 30 | ADST 2345 | TRUE |
43 | Cocoa and Hazelnut Biscuits | 6 | 32 | 28 | 23 | 15 | 40 | ADSD 2345 | TRUE |
44 | Cream and honey biscuits | 6 | 25 | 39 | 29 | 10 | 30 | ADSL 2345 | TRUE |
45 | Mushrooms Sauce | 6 | 30 | 21 | 22 | 10 | 25 | ADST 2345 | TRUE |
46 | Artichokes in white sauce | 6 | 20 | 22 | 50 | 0 | 25 | ADST 2345 | TRUE |
47 | Chocolate Chip Cookies | 6 | 25 | 49 | 50 | 0 | 30 | ADST 2345 | TRUE |
48 | Oatmeal Raisin Walnut Cookies | 7 | 30 | 43 | 19 | 20 | 30 | KDRT-2345 | TRUE |
49 | Chunky Chocolate Cookies | 7 | 30 | 15 | 33 | 20 | 40 | KDRT-2345 | TRUE |
50 | Fudge Nut Brownie Cookies | 7 | 25 | 44 | 37 | 0 | 25 | KDRT-2345 | TRUE |
51 | Coconut Chocolate Chip Cookies | 7 | 35 | 25 | 28 | 0 | 25 | KTRT-4589 | TRUE |
52 | Vanilla Sugar Cookies | 7 | 30 | 22 | 35 | 0 | 40 | KTRT-4589 | TRUE |
53 | Apple Cinnamon Raisin Cookies | 7 | 30 | 27 | 15 | 20 | 30 | KTRT-4589 | TRUE |
54 | Chocolate Chip Brownie | 8 | 35 | 30 | 47 | 0 | 25 | KTRT-4589 | TRUE |
55 | Caramel Brownie | 8 | 26 | 16 | 41 | 0 | 35 | KTRT-4589 | TRUE |
56 | Fruit Dip | 8 | 30 | 49 | 25 | 15 | 40 | KTRT-4589 | TRUE |
57 | Raspberry brownie bar | 8 | 25 | 22 | 23 | 10 | 25 | KTRT-4589 | TRUE |
58 | Chili Salsa | 8 | 32 | 45 | 33 | 0 | 35 | KTRT-4589 | TRUE |
59 | Buttermilk Muffins | 8 | 34 | 46 | 31 | 0 | 35 | KTRT-4589 | TRUE |
60 | Dried Bluberries Gift Box - 6 oz. | 8 | 24 | 29 | 26 | 0 | 25 | KTRT-4589 | TRUE |
61 | Dried Red Tart Cherries Gift Box - 6 oz. | 9 | 26 | 43 | 18 | 15 | 30 | EPDA-2345 | TRUE |
62 | Dried Red Tart Cherries - 1lb. | 9 | 20 | 16 | 30 | 5 | 30 | EPDA-2345 | TRUE |
63 | Dried Cranberries - 6oz. | 9 | 30 | 16 | 45 | 0 | 25 | EPDA-2345 | TRUE |
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started