Select sumquantity from stock where quantity 0 phase

Info icon This preview shows page 4. Sign up to view the full content.

Select sum(Quantity) From stock Where quantity > 0 Phase 7 – Subqueries Step 1 – Write a subquery that displays the PartName and Quantity from the STOCK table where the OrderID is 10309 in the ORDERS table. Select PartName, Quantity From Stock Where PartID IN o (select PartID From Orders Where OrderID = 10309); Step 2 – Write a subquery that displays the name, country, and phone number from the CUSTOMER table where that customer ordered a part with a quantity greater than 40. Select Name, Country, Phone From Customer Where CustomerID IN o (Select CustomerID From Orders Where PartID in (Select PArtID From stock Where Quantity > 40)); Phase 8 – JOINS Step 1 – Write a join query that displays the OrderID, Part Number, Part Name, Quantity of all orders placed by CustomerID = 5 Select o.OrderID, s.PartID, s.PartName, s.Quantity From orders as o inner join stock as s ON o.partID = s.partID where o.customerID = 5; Step 2 – Write a join query that displays ALL of the customers, their Order IDs, and Order Ship Dates Select c.Name, o.orderID, o.ShippingDate From CUSTOMER as c left join ORDERS as o ON c.customerID = o.customerID
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.
  • Spring '08
  • MCCONN,CHARLOTTERYOO,JUNGWOO
  • PartID

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern