select u.name, sum(amount)
from account a
join user u on u.id = a.user_id
join operation o on o.account_id = a.id
where a.currency = 'EUR'
group by u.id, u.name
having sum(amount) > (
select avg(amount)
from account a
join operation o on o.account_id = a.id
where a.currency = 'EUR'
)
ALTER TABLE customer
ADD CONSTRAINT CHECK(phone REGEXP '^[0-9]{3}-[0-9]{2}-[0-9]{3}$');