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 964815
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T01:53:31+00:00 2026-05-16T01:53:31+00:00

I got a skill test for a quick mysql query. I am given the

  • 0

I got a skill test for a quick mysql query. I am given the tables:

    Orders                    OrderItems
----------------------------------------                
    id                         id
    date                       order_id(Orders.id)
    shipping_amount            product_id
    order_status               price
    customer_id             quantity

I need to show Orders id and totals (including shipping amount) and records prior to June 1, 2003.

output should be…

| OrderID   | OrderTotal |
+-----------+------------+
| 13230     | $55.00     |
| 54455     | $40.00     |
| 59694     | $33.04     |
| 39495     | $21.05     |

The hint is to use Group by or subselect. I have the following statement so far but not sure what to do next.

Select id AS OrderId,***(not sure what to do here) 
from Orders join OrderItems on Orders.id=OrderItems.id 
  • 1 1 Answer
  • 1 View
  • 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-16T01:53:32+00:00Added an answer on May 16, 2026 at 1:53 am

    I don’t have access to a mysql database to test, but I would imagine it looks something like this:

    select
      o.id OrderID,
     (select sum(oi.price * oi.quantity) from order_items oi where oi.order_id = o.id) + o.shipping_amount OrderTotal
    from
      orders o
    where
      o.date < str_to_date('2003-06-01', '%Y-%m-%d');
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write Classes to show some people in my skill test.
We've got a multiproject we're trying to run Cobertura test coverage reports on as
I applied for a job and got a little test to do. Its pretty
I recently started these projects to test my skills with Java. I got to
Ive got an anchor link <a href=http://bucket_name.amazonaws.com/uploads/users/4/songs/7/test.mp3>Download</a> How do I make it so when
I have the following problem. I got a bat file that runs testcomplete test.
I've got my site in htdocs/mysite which I'll be using to test/develop my website
I just did a quick test with a simple ASP.NET MVC 3 sample by
Following up on this post , I made a test, but I still got
Got the developer certificate to test app on iphone entered device identifier, connected iphone

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.