Solved

SQL Questions

Posted on 2013-01-14
2
197 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 77

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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to show the last employee that updated a record 5 44
sql help 5 52
SQL Server 2012 express 24 36
Bubble user-defined Sql RAISERROR(...) to c# exception 14 145
This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

910 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

21 Experts available now in Live!

Get 1:1 Help Now