logo

Back to questions

Photoshop Revenue Analysis

Medium

For every customer that bought Photoshop, return a list of the customers, and the total spent on all the products except for Photoshop products.

Sort your answer by customer ids in ascending order.

Table:

Column NameType
customer_idinteger
productinteger
revenueinteger

Example Input:

customer_idproductrevenue
123Photoshop50
123Premier Pro100
123After Effects50
234Illustrator200
234Premier Pro100

Example Output:

customer_idrevenue
123150

Explanation: User 123 bought Photoshop, Premier Pro + After Effects, spending $150 for those products. We don't output user 234 because they didn't buy Photoshop.

PostgreSQL 14

Refer friends to get bonus content & cool prizes.