# Monthly 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/3972/monthly-sales-report
Source observed: 2026-11-04T23:34:26.732Z
Last checked: 2026-11-04T23:34:26.732+00:00
Indexed: 2026-11-05T11:57:00.484+00:00

---

# Monthly Sales Report

We provide this medium-difficulty coding question in our SQL interview-question library. It asks you to modify a previous sales-report query so that it covers multiple years and returns one result per month-year.

## Schema

### `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 |

## Task

Modify the previous query to report results for multiple years. Group the results by month-year and return these columns:

- `month_year`
- `num_customers`
- `num_orders`
- `order_amt`

Order the result by `month_year` in descending order.

The question is categorized as [Coding](https://www.aced.io/questions?type=coding) and [SQL](https://www.aced.io/questions?type=sql). Detailed company statistics are available through [Upgrade](https://www.aced.io/upgrade?src=questions).

## Answer and practice options

No community answers have been contributed yet. We provide a [Solution](https://www.aced.io/questions/3972/monthly-sales-report) area and an interactive SQL editor with Output, Test Results, and Console panels. You can [sign up to run code](https://www.aced.io/signup?src=lesson).

## Related question

- [Sales Report](https://www.aced.io/questions/3971/sales-report)

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

---

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