# Find Average Purchase Value — 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/3959/find-average-purchase-value
Source observed: 2026-11-04T23:34:24.130Z
Last checked: 2026-11-04T23:34:24.13+00:00
Indexed: 2026-11-06T14:51:19.137+00:00

---

# Find Average Purchase Value

**Difficulty:** Easy  
**Categories:** [Coding](https://www.aced.io/questions?type=coding), [SQL](https://www.aced.io/questions?type=sql)  
**Interview type:** Coding  
**Reported last asked:** 2 years ago

We provide interview-preparation courses, practice questions, coding exercises, and related coaching through Aced, formerly Exponent. This question asks you to calculate average purchase value by marketing channel using two relational tables.

## Prompt

You are given the following tables.

### `attribution`

| Column | Type |
| --- | --- |
| `session_id` | `string` |
| `marketing_channel` | `string` |
| `purchase_value` | `float` |

### `user_sessions`

| Column | Type |
| --- | --- |
| `session_id` | `string` |
| `ad_click_timestamp` | `datetime` |
| `user_id` | `string` |

Find the average value of purchases made through each marketing channel. Arrange the results in descending order, beginning with the channel with the highest average purchase value.

Your output must contain these columns:

| Column | Meaning |
| --- | --- |
| `marketing_channel` | The marketing channel associated with the purchase sessions |
| `avg_purchase_value` | The average purchase value for that channel |

The prompt supplies both tables and their schemas. The required solution is not included in the supplied content.

## Access and practice

Detailed company statistics for this question require an [upgrade](https://www.aced.io/upgrade?src=questions). We provide an in-page editor with **Question**, **Solution**, and **Community** tabs; the supplied content indicates that no community answers have been contributed yet. Running code requires [sign-up](https://www.aced.io/signup?src=lesson).

## Related question

- [Find Campaign Purchases](https://www.aced.io/questions/3963/find-campaign-purchases)

## Other Aced learning areas

We offer interview preparation in 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. We also provide interview loops, experiences, practice, mock interviews and coaching, resume review, salary negotiation, pricing information, job referrals, resources, and services for universities, businesses, recruiters, and affiliates.

Our main site is [Aced](https://www.aced.io/?src=nav), formerly Exponent. You can browse [all questions](https://www.aced.io/questions), [courses](https://www.aced.io/courses?src=nav), or [log in](https://www.aced.io/login?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%2F3959%2Ffind-average-purchase-value&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%2F3959%2Ffind-average-purchase-value). Opening a form does not execute a tool.