Hi! Could we please enable some services and cookies to improve your experience and our website?

SQLize Online / PHPize Online  /  SQLtest Online

A A A
Login    Share code      Blog   FAQ

Online Sandbox for SQL and PHP: Write, Run, Test, and Share SQL Queries and PHP Code

Copy Format Clear
select department_name, avg(case when salary > 3000 then salary else 0 end) as average_salary from employees e join departments d on d.department_id = e.department_id group by d.department_name

Stuck with a problem? Got Error? Ask AI support!

Copy Clear