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

Transactions Above Three Times the Account Average

Return the ids of transactions whose amount is more than three times the average transaction amount of the same account. Order by id.

Table schema

Transactions(id INT PRIMARY KEY, account_id INT, amount INT)

Sample data

id | account_id | amount
1 | 1 | 10
2 | 1 | 10
3 | 1 | 10
4 | 1 | 100
5 | 2 | 20
6 | 2 | 25

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.