Skip to main content
Practice

Find Customers with High-Priced Ticket Purchases

The marketing team wants to identify customers who tend to buy premium event tickets, so they can target them with special offers.

Your task is to find all customers who have made at least one purchase where the ticket price was higher than average.

To solve this, you'll use a subquery inside the WHERE clause to compare each purchase to the overall average ticket price.


Task

From the event_ticketing.sqlite database, return:

  • name (from the customers table)

Only include customers who have purchased at least one ticket with a price above the average across all purchases.


How to solve it

Write a SQL query that joins customers with purchases, and filters for rows where the ticket price is greater than the average price.

Use a subquery inside the WHERE clause to calculate the average ticket price.

Want to learn more?

Join CodeFriends Plus membership or enroll in a course to start your journey.