# Sales Report — 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/3971/sales-report
Source observed: 2026-11-04T23:34:33.630Z
Last checked: 2026-11-04T23:34:33.63+00:00
Indexed: 2026-11-06T16:20:55.508+00:00

---

# Sales Report

We provide this **Medium** SQL interview question through Aced (formerly Exponent). It is a coding question categorized under **Coding** and **SQL**. The question is associated with one interview and was last asked **2 years ago**.

## Problem

You are given these tables:

### `transactions`

| Column | Type |
|---|---|
| `id` | integer |
| `user_id` | integer |
| `created_at` | datetime |
| `product_id` | integer |
| `quantity` | integer |

### `products`

| Column | Type |
|---|---|
| `id` | integer |
| `name` | string |
| `price` | float |

### `users`

| Column | Type |
|---|---|
| `id` | integer |
| `name` | string |
| `sex` | string |

Write a query to report the following per month during **2020**:

- The number of users
- The number of transactions placed
- The total order amount

Your output must contain these columns:

| Column | Description from the prompt |
|---|---|
| `month_name` | Month name |
| `num_customers` | Number of users/customers |
| `num_orders` | Number of transactions/orders |
| `order_amt` | Total order amount |

Order the results by descending month.

## Aced question workspace

The question includes **Question**, **Solution**, and **Community** tabs. The community section currently has no contributed answers. The coding workspace includes **Editor**, **Share**, **Output**, **Test Results**, and **Console** views. Running code requires an account: [Sign up to run code](https://www.aced.io/signup?src=lesson).

Detailed company statistics for this question require an upgrade: [Upgrade](https://www.aced.io/upgrade?src=questions).

## Related questions

- [Monthly Sales Report](https://www.aced.io/questions/3972/monthly-sales-report)
- [Sales Path](https://www.aced.io/questions/3051/sales-path)

## Aced learning areas

We offer interview preparation across these areas:

- [Product Management](https://www.aced.io/courses/pm?src=nav) — Ace product interviews from strategy cases to technical skills.
- [Forward Deployed](https://www.aced.io/courses/forward-deployed-engineering?src=nav) — Beta preparation for FDE loops at Anthropic, OpenAI, Palantir, and more.
- [Engineering Management](https://www.aced.io/courses/engineering-management?src=nav) — Review key leadership and people-management skills.
- [Software Engineering](https://www.aced.io/courses/software-engineering?src=nav) — Learn strategies for coding problems and more.
- [System Design](https://www.aced.io/courses/system-design-interviews?src=nav) — Define architectures, interfaces, and databases in a time crunch.
- [Data Science](https://www.aced.io/courses/data-science?src=nav) — Execute statistical techniques and experimentation effectively.
- [Machine Learning](https://www.aced.io/courses/ml-engineer?src=nav) — Review building, evaluating, and deploying AI/ML models.
- [Data Engineering](https://www.aced.io/courses/data-engineering?src=nav) — Design complex data models and ETL pipelines.
- [AI Engineering](https://www.aced.io/courses/ai-engineering?src=nav) — New.
- [Investment Banking](https://www.aced.io/ib?src=nav) — New.
- [Generative AI](https://www.aced.io/courses/gen-ai-interviews?src=nav)
- [Security Engineer](https://www.aced.io/courses/security-engineer?src=nav)
- [TPM](https://www.aced.io/courses/tpm?src=nav)
- [Solutions Architect](https://www.aced.io/courses/solution-architect-interview?src=nav)
- [UX / Product Design](https://www.aced.io/courses/product-designer-interview?src=nav)
- [BizOps & Strategy](https://www.aced.io/courses/bizops?src=nav)

We also offer [Loops](https://www.aced.io/guides?src=nav), [Experiences](https://www.aced.io/experiences?src=nav), [Practice](https://www.aced.io/practice?src=nav), [Coaching](https://www.aced.io/coaching?src=nav), and [Pricing](https://www.aced.io/upgrade?src=nav). Coaching includes [Mock Interviews & Coaching](https://www.aced.io/coaching?category=mock_interviews&src=nav), [Resume Review](https://www.aced.io/resume?src=nav), [Salary Negotiation](https://www.aced.io/coaching?category=negotiation&src=nav), and [How Coaching Works](https://www.aced.io/coaching/start?src=nav).

## Access

- [All Questions](https://www.aced.io/questions)
- [Sign up](https://www.aced.io/signup?src=nav)
- [Log in](https://www.aced.io/login?src=nav)

Aced was formerly known as Exponent.

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3971%2Fsales-report&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%2F3971%2Fsales-report). Opening a form does not execute a tool.