Solved

SQL Questions

Posted on 2013-01-14
2
200 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 78

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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills PIVOT is a great facility and solves many an EAV (Entity - Attribute - Value) type transformation where we need the information held as data within a column to become columns in their own right. Now, in some cases that is relatively…
by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…

696 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