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
  • 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-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

Ask A Question

Stats

  • Questions 493k
  • Answers 493k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer I would try sinking the game drop section and giving… May 16, 2026 at 10:51 am
  • Editorial Team
    Editorial Team added an answer The short answer is no. sqlps is minishell, where the… May 16, 2026 at 10:51 am
  • Editorial Team
    Editorial Team added an answer No, in both cases you get a queryset. In the… May 16, 2026 at 10:51 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I am trying to write Classes to show some people in my skill test.
A friend (fellow low skill level recreational python scripter) asked me to look over
So we learned a bit about the Turing Test in my AI class. This
I am trying to deploy a test ASP.NET MVC site to a site hosted
Basically I set up a test to see which method is the fastest way
Got an application (C# WPF) that needs to call home and get updated stuff
I got two forms and they share some ids as two input fields are
I've got this 1 minute long movie that I want to compile into an
I am trying to create CGImage from NSTextField. I got some success in this.
I have real trouble understanding mod_rewrite, and got some help in creating a RewriteRule

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.