mis235SQL2 - Mike Mesrobian MIS 235 Section P 3/16/2010 SQL...

Info iconThis preview shows pages 1–3. Sign up to view the full content.

View Full Document Right Arrow Icon
Mike Mesrobian MIS 235 Section P 3/16/2010 SQL Assignment #2 1. select SUM(mis235.OrderDetails.UnitPrice * mis235.OrderDetails.Quantity), mis235.Orders.CustomerID From mis235.OrderDetails, mis235.Orders Group By mis235.Orders.CustomerID Order By mis235.Orders.CustomerID asc SUM(MIS235.ORDERDETAILS.UNITPRICE*MI S235.ORDERDETAILS.QUANTITY) CUSTO 8126751.54 ALFKI 5417834.36 ANATR 9481210.13 ANTON 17607961.7 AROUT 24380254.6 BERGS 2. Select mis235.customers.customerid, mis235.orders.orderid, count(unitprice*quantity) from mis235.customers, mis235.orders, mis235.orderdetails where mis235.orders.orderid=mis235.orderdetails.orderid and mis235.customers.customerid=mis235.orders.customerid having mis235.customers.customerid='ALFKI' group by mis235.customers.customerid, mis235.orders.orderid; CUST O ORDERI D COUNT(UNITPRICE*QUANTITY ) ALFKI 11011 2 ALFKI 10952 2 ALFKI 10702 2 ALFKI 10692 1 3. select count(customerid), country from mis235.customers group by country
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
COUNT(CUSTOMERID) COUNTRY 9 Brazil
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

mis235SQL2 - Mike Mesrobian MIS 235 Section P 3/16/2010 SQL...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online