HW03_Liu_Jim_jpl222 - ORDER BY A1.AnnualDollarSales DESC ,...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Jim Liu ORIE 3120 Hwk 3 1. Q010HWK3InitialQuery: (A1 is the ParetoHomework table, and A2 is just an alias) SELECT A1.ProductID, A1.AnnualDollarSales, Count(A1.ProductID) AS SalesRank, Sum(A2.AnnualDollarSales) AS CumulativeSales FROM A1, A2 WHERE (((A1.AnnualDollarSales)<=A2.AnnualDollarSales)) Or (((A1.AnnualDollarSales)=A2.AnnualDollarSales) And ((A1.ProductID)=A2.ProductID)) GROUP BY A1.ProductID, A1.AnnualDollarSales
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: ORDER BY A1.AnnualDollarSales DESC , A1.ProductID DESC; Q020HWK3FinalQuery: SELECT [Q010HWK3InitialQuery].SalesRank, [Q010HWK3InitialQuery].CumulativeSales FROM Q010HWK3InitialQuery; Q020HWK3FinalQuery SalesRa nk CumulativeSal es 1 12640 2 20913 3 25608 4 28479 5 30306 6 31363 7 32050 8 32460 9 32691 10 32837 11 32925 12 32982 13 33014 14 33033 5000 10000 15000 20000 25000 30000 35000...
View Full Document

This note was uploaded on 04/28/2009 for the course 1920 1920 taught by Professor Connelly during the Fall '10 term at Cornell University (Engineering School).

Ask a homework question - tutors are online