Solved

SQL Questions

Posted on 2013-01-14
2
196 Views
Last Modified: 2013-01-15
I need a query to get the below points:  Tables are in the attached document.  Thanks.

What would be the discounts for each line item on orders of five or more units?

o      Columns to display: Orderid, Partid, Description, Qty, UnitPrice, OriginalCost, QuantityDeduction, and FinalCost

o       give quantity discounts to encourage more sales.
·      If an order contains five or more units of a given product we will give a 2% discount for that line item.  
·      If an order contains ten or more units of a given product we will give a 5% discount on that line item.

o      Produce output that prints the orderid, partid, description, qty ordered, unit list price, the total original price(qty ordered * list price),  the total discount value (shown as money or percent), and the total final price of the product after the discount.

o      Display only those line items subject to the discount in ascending order by the orderid and partid.

o      Use the CASE statement.
sqltables.doc
0
Comment
Question by:ocdc
2 Comments
 
LVL 76

Accepted Solution

by:
arnold earned 500 total points
ID: 38777212
Is this a class assignment.

You can use quantity order divided by the threshold cast as int and is multiplied by the discount.
Can you post the query you are considering and what issues are you having with the query?
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

Suggested Solutions

I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now