Skip to main content
Admissions guidance, study banks, and career tools — get started on Shalyam

Revenue per Event

Return each event name and its total ticket revenue, highest first.

Table schema

Events(id INT PRIMARY KEY, name VARCHAR(10), capacity INT)
Tickets(id INT PRIMARY KEY, event_id INT, buyer VARCHAR(10), price INT)

Sample data

Events
id | name | capacity
1 | Rock | 3
2 | Jazz | 5
3 | Folk | 2

Tickets
id | event_id | buyer | price
1 | 1 | Ann | 100
2 | 1 | Bob | 100
3 | 1 | Cy | 120
4 | 2 | Ann | 80
5 | 2 | Ann | 80
6 | 2 | Ann | 80
7 | 3 | Dee | 50

Discussion

No discussions yet.

Rewards · v2.1

Get Exclusive Insights with Every Issue

Join Shalyam Newsletter

Stay ahead in education, research, and innovation—straight to your inbox.