Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6675487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T03:51:43+00:00 2026-05-26T03:51:43+00:00

I am still a noobie when it comes to the SQL server. I know

  • 0

I am still a noobie when it comes to the SQL server. I know something but other still seem so confusing. I know the more you practice with it the better you get. Well I am working on this part that kinda has my mind confused. It is using northwind database show the most recent five orders that were purchased from a customer who has spent more than $25,000. Ok I know I will use the customer table, and the order table. What is putting my mind crazy is how do you get it where the 5 customers who spent 25,000 up. I am sure I probably know it but my mind is not thinking it does.

The reason why I think this one is hard for me is because I have a order detail which has the OrderID, ProductID, UnitPrice,Quantity, and discounts in it.

then you have Orders which don’t have any information with it that deals with the money issue. Then you have the customers which I know I will need to use that to show the 5 customers who spent more than 25,000.

With the Order Detail I don’t know how to use it that well because they are split into two names. I am woundering can I put a bracket around it since there is a space between the two words.

I am sure people are going to vote this down or say i seen this on SQL dummies but I am just trying to understand this. I know you can not see my database to see what I am looking at but I will also try in my best to explain why I am so confused. I am just trying to understand this. Thanks to all who looked at this topic.

This is what I have so far I know I am missing to add the 5 in there I am just not understanding where too.

  SELECT ContactName FROM Customers
    INNER JOIN [Order Details]ON OrderId = 
CustomerID
INNER JOIN Orders ON Product.ID = Orders.ID
WHERE UnitPrice >= 25000
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T03:51:43+00:00Added an answer on May 26, 2026 at 3:51 am

    You need to join on a subquery from order details so you can get the order total.

    select Top 5 [Customer].ContactName,[Order].OrderDate,detail.total
    from [Customer] inner join
    [Order] on [Customer].CustomerID = [Order].CustomerID inner join
    (SELECT [OrderID],SUM(([UnitPrice]*[Quantity])-[Discount]) as total FROM [OrderDetail] GROUP BY [OrderID]) as detail on [Order].OrderID = detail.OrderID
    WHERE detail.total > 25000
    ORDER BY [Order].OrderDate DESC
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Still wrapping my head around SQL and PHP, but hope someone can help with
I am still kinda noobie with pre_match. I am trying to get the pre_match
Still no answer...anyone have something better? Okay complex 2 part question here. I have
Still 'diving in' to Python, and want to make sure I'm not overlooking something.
Still working through JQuery to get data and repopulate portions of a page. Right
still a bit of a n00b on SharpSVN, I'm looking to get some simple
Still learning Objective-C / iPhone SDK here. I think I know why this wasn't
Still trying to get my problems with page loaders firing like crazy in JSF>
still on regex! i want learn it but i'm still crashing the head into
Still trying to get the navigation control of a new site working the way

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.