HW_02SQLandThroughput - ORIE 3120: Industrial Data and...

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

View Full Document Right Arrow Icon
1 ORIE 3120: Industrial Data and Systems Analysis Spring 2011 Homework #2 Due Date: 2/9/11 (Wednesday) noon Rhodes Hall Course Dropbox 1. Structured Query Language: Joins and Aggregations (12 points) The RawNorthwind database used in Recitation 1 has the following schema. Observe in the OrderDetails table that the sales value can be computed by multiplying Quantity by UnitPrice. The discounted sales value (the value of the sale after the discount, if any) is the sales value multiplied by (1-discount). That is, the discount field is expressed as a fraction (even though it is displayed as a percentage). To be clear, “discounted sales” refers to the value of the sale less any discount. (Some students have thought it referred to only those sales with positive discounts.) Write a series of queries that will result in a listing of total discounted sales (in dollars) grouped by category, by year and by month of the order date. For example, your first query could calculate some useful fields and a second query could aggregate the result of the first query. Use the functions YEAR() and MONTH() to extract the date information from the OrderDate field. Round off total discounted sales to the nearest whole dollar (the ROUND()
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 03/18/2012 for the course ORIE 3120 taught by Professor Jackson during the Spring '09 term at Cornell University (Engineering School).

Page1 / 3

HW_02SQLandThroughput - ORIE 3120: Industrial Data and...

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

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