Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SQL Questions

Posted on 2013-01-14
2
Medium Priority
?
203 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 80

Accepted Solution

by:
arnold earned 1000 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
Video by: ITPro.TV
In this episode Don builds upon the troubleshooting techniques by demonstrating how to properly monitor a vSphere deployment to detect problems before they occur. He begins the show using tools found within the vSphere suite as ends the show demonst…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

636 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