# E-commerce (2 of 5) — SQL interview question

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/3103/e-commerce-part-2
Source observed: 2026-11-04T23:34:34.299Z
Last checked: 2026-11-04T23:34:34.299+00:00
Indexed: 2026-11-07T02:09:11.157+00:00

---

# E-commerce (2 of 5)

**Difficulty:** Easy  
**Categories:** [Coding](https://www.aced.io/questions?type=coding), [SQL](https://www.aced.io/questions?type=sql)

We provide interview preparation through questions, courses, practice, coaching, and related career resources. This question is an SQL exercise about Amazon's e-commerce orders.

## Question

Amazon is a large e-commerce platform where customers can order items ranging from electronics to clothing.

You are given two tables, `orders` and `items`.

### `orders`

| Column | Type |
| --- | --- |
| `order_id` | `integer` |
| `customer_id` | `integer` |
| `order_date` | `date` |
| `item_id` | `integer` |
| `order_quantity` | `integer` |

### `items`

| Column | Type |
| --- | --- |
| `item_id` | `integer` |
| `item_category` | `string` |

Write an SQL query that determines how many units were ordered from Amazon's e-commerce platform in the last week. The output must contain these columns:

| Required column | Meaning |
| --- | --- |
| `item_category` | The item's category |
| `total_units_ordered_last_7_days` | The total number of units ordered during the last 7 days |

The question requires combining order quantities with item categories using the available table fields and applying a seven-day date filter. No SQL solution is included in the available content.

## Question controls and access

The question interface includes **Question**, **Solution**, **Mock Interview**, and **Community13** tabs. Detailed company statistics are available through [Upgrade](https://www.aced.io/upgrade?src=questions). The coding environment includes editor, sharing, output, test-results, and console views; [sign up to run code](https://www.aced.io/signup?src=lesson).

## E-commerce question series

This question is the second of five related e-commerce exercises:

1. [E-commerce: Units Ordered Yesterday](https://www.tryexponent.com/courses/sql-interviews/e-commerce-i) — 1 of 5
2. **E-commerce (2 of 5)** — this question
3. [E-commerce: Total Orders by Category](https://www.tryexponent.com/courses/sql-interviews/e-commerce-iii) — 3 of 5
4. [E-commerce: Earliest Order by Customer](https://www.tryexponent.com/courses/sql-interviews/e-commerce-iv) — 4 of 5
5. [E-commerce: Second Earliest Order](https://www.tryexponent.com/courses/sql-interviews/e-commerce-v) — 5 of 5

## Related questions

- [E-commerce (5 of 5)](https://www.aced.io/questions/3106/e-commerce-part-5)
- [E-commerce (4 of 5)](https://www.aced.io/questions/3105/e-commerce-part-4)
- [E-commerce (1 of 5)](https://www.aced.io/questions/3102/e-commerce-part-1)

[All Questions](https://www.aced.io/questions)

## Company and learning resources

We are Aced, formerly Exponent. Our available learning areas include Product Management, Forward Deployed Engineering, Engineering Management, Software Engineering, System Design, Data Science, Machine Learning, Data Engineering, AI Engineering, Investment Banking, Generative AI, Security Engineer, TPM, Solutions Architect, UX / Product Design, and BizOps & Strategy. We also offer interview loops, experiences, practice, mock interviews and coaching, resume review, salary negotiation, job referrals, resources, and related programs.

- [Courses](https://www.aced.io/courses?src=nav)
- [Questions](https://www.aced.io/questions?src=nav)
- [Practice](https://www.aced.io/practice?src=nav)
- [Coaching](https://www.aced.io/coaching?src=nav)
- [Pricing](https://www.aced.io/upgrade?src=nav)
- [Log in](https://www.aced.io/login?src=nav)
- [Sign up](https://www.aced.io/signup?src=nav)

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3103%2Fe-commerce-part-2&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3103%2Fe-commerce-part-2). Opening a form does not execute a tool.