The document contains multiple SQL queries that are selecting data from angajati (employees) and departamente (departments) tables. The queries are filtering on salary fields, joining the tables on department IDs, grouping results, and finding minimum, maximum and aggregated salary values to return employee names, departments, salaries that meet various criteria.
The document contains multiple SQL queries that are selecting data from angajati (employees) and departamente (departments) tables. The queries are filtering on salary fields, joining the tables on department IDs, grouping results, and finding minimum, maximum and aggregated salary values to return employee names, departments, salaries that meet various criteria.
The document contains multiple SQL queries that are selecting data from angajati (employees) and departamente (departments) tables. The queries are filtering on salary fields, joining the tables on department IDs, grouping results, and finding minimum, maximum and aggregated salary values to return employee names, departments, salaries that meet various criteria.
from angajati where salariu = (SELECT max(salariu) FROM angajati);
select id_dep, nume, functie, salariu
from angajati where data_
select den_dep, nume, salariu
from angajati NATURAL JOIN departamente where salariu IN (select MAX(salariu) from angajati GROUP BY id_dep)
select nume, functie, salariu
from angajati natural join departamente where salariu > (select MAX(salariu) from angajati where den_dep = 'SALES');
select a.nume, b.den_dep, a.salariu
from angajati a natural join departamente b where a.salariu = (select min(salariu) from angajati c where c.id_dep = a.id_dep)
select a.nume, b.den_dep, a.salariu
from angajati a, (select c.id_dep, d.den_dep, max(c.salariu) from angajati c natural join departamente d group by id_dep) select den_dep from departamente where a.id_dep = id_dep
select a.nume, b.den_dep, a.salariu
from angajati a, departamente b where a.id_dep = b.id_dep and a.salariu = (select min(salariu) from angajati c where c.id_dep = a.id_dep)
select a.nume, b.den_dep, a.salariu
from angajati a join departamente b on b.id_dep = a.id_dep where a.salariu = (select min(salariu) from angajati c where c.id_dep = a.id_dep)
select a.nume, b.den_dep, a.salariu
from angajati a join departamente b on b.id_dep = a.id_dep where (a.id_dep, a.salariu) = (select x.id_dep, min(x.salariu) from angajati x where a.id_dep = x.id_dep group by x.id_dep)