-- 1 method
select e.name, t.deptname, e.salary from
(select avg(salary) as averagesalary from tblemployee) as Budget, --first from
tblemployee as e  --second from
join tbldepartment t
on e.deptid = t.deptid
where e.salary > Budget.averagesalary;
-- 2th method
select e.name, t.deptname, e.salary from
tblemployee as e
join tbldepartment t
on e.deptid = t.deptid
where e.salary > (select avg(salary) as averagesalary from tblemployee);