Preview:
-- 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);
downloadDownload PNG downloadDownload JPEG downloadDownload SVG

Tip: You can change the style, width & colours of the snippet with the inspect tool before clicking Download!

Click to optimize width for Twitter