Course Hero Logo

Chapter5SQL.docx - Chiss Batista CST 1204 10/26/2017 SQL...

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 1 - 4 out of 8 pages.

Chiss BatistaCST 120410/26/2017SQL project – Chapter 51.Listing the order number, order date, along with the number and name of the customerthat placed the order.SELECT ORDER_NUM, ORDER_DATE, ORDERS.CUSTOMER_NUM,CUSTOMER_NAMEFROM ORDERS, CUSTOMERWHEREORDERS.CUSTOMER_NUM = CUSTOMER.CUSTOMER_NUM;ORDER_NUMORDER_DATECUSTOMER_NUMCUSTOMER_NAME5160810/12/2015126Toys Galore5161010/12/2015334The EverythingShop5161310/13/2015386Johnson’sDepartmentStore5161410/13/2015260Brookings Direct5161710/15/2015586AlmondtonGeneral Store5161910/15/2015126Toys Galore5162310/15/2015586AlmondtonGeneral Store5162510/16/2015796Unique Gifts2.Order name and number of customers who placed an order on October 15, 2015.In Oracle and SQL Server, the command is:SELECT ORDER_NUM,ORDERS.CUSTOMER_NUM, CUSTOMER_NAMEFROM ORDERS, CUSTOMERWHERE ORDERS.CUSTOMER_NUM = CUSTOMER.CUSTOMER_NUM ANDORDER_DATE = '10/15/2015';ORDER_NUMORDER_DATECUSTOMER_NUMCUSTOMER_NAME5161710/15/2015586AlmondtonGeneral Store5161910/15/2015126Toys Galore5162310/15/2015586AlmondtonGeneral Store
3.Listing the order number, order date, item number, the number of units ordered, andquoted price for each order line that makes up the order.4.Use the IN operator to find the number and name of each customer that placed anorder on October 15, 2015.SELECT CUSTOMER_NUM, CUSTOMER_NAME FROM CUSTOMER WHERECUSTOMER_NUM IN (SELECT CUSTOMER_NUM FROM ORDERS WHEREORDER_DATE = ‘10/15/2015’);5.Repeat exercise 4, but this time use the EXISTS operator in your answer.SELECT CUSTOMER_NUM, CUSTOMER_NAME FROM CUSTOMER

Upload your study docs or become a

Course Hero member to access this document

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 8 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
N/A
Tags

Newly uploaded documents

Show More

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture