# Find Customers by Department — 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/3966/find-customers-by-department
Source observed: 2026-11-04T23:18:06.293Z
Last checked: 2026-11-04T23:18:06.293+00:00
Indexed: 2026-11-06T08:44:32.781+00:00

---

# Find Customers by Department

We provide interview preparation through Aced (formerly Exponent), including coding and SQL practice questions. This medium-difficulty question asks you to query customer orders by department and year.

## Question

You are given these tables:

### `orders`

| Column | Type |
|---|---|
| `order_id` | integer |
| `customer_id` | integer |
| `order_date` | date |
| `order_amount` | integer |
| `department_id` | integer |

### `departments`

| Column | Type |
|---|---|
| `department_id` | integer |
| `department_name` | string |

### `customers`

| Column | Type |
|---|---|
| `customer_id` | integer |
| `first_name` | string |
| `last_name` | string |

Find how many customers ordered from the electronics and the fashion department respectively in 2022. Your output should have the following columns: `customers`, `department_name`.

## Practice interface

The question is categorized as [Coding](https://www.aced.io/questions?type=coding) and [SQL](https://www.aced.io/questions?type=sql). The available interface includes **Question**, **Solution**, and **Community4** tabs, plus an editor with **Editor** and **Share** views and **Output**, **Test Results**, and **Console** panels.

You can [sign up to run code](https://www.aced.io/signup?src=lesson). Detailed company statistics for this question are available through [Upgrade](https://www.aced.io/upgrade?src=questions).

The question metadata identifies it as a coding interview question and says it was last asked 2 years ago. No community answers have been contributed yet.

## Related questions

- [Find Revenue by Department](https://www.aced.io/questions/3965/find-revenue-by-department)
- [Find Top Customer by Year](https://www.aced.io/questions/3977/find-top-customer-by-year)
- [Rank Salary by Department](https://www.aced.io/questions/4379/rank-salary-by-department)

## Aced learning areas

We provide interview preparation across areas including Product Management, Forward Deployed Engineering, Engineering Management, Software Engineering, System Design, Data Science, Machine Learning, Data Engineering, AI Engineering, Investment Banking, Generative AI, Security Engineering, TPM, Solutions Architecture, UX / Product Design, and BizOps & Strategy. Our question library includes Product Management, Behavioral, Coding, System Design, SQL, Machine Learning, Investment Banking, and Data Engineering categories.

---

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