SELECT nomd, count(*)
from emp, dept
where emp.dept = dept.dept
group by nomd
ORDER BY nomd

Si Java DB acceptait la syntaxe avec natural join, on aurait aussi pu écrire :

SELECT nomd, count(*)
from emp natural join dept
group by nomd
ORDER BY nomd