Professional Documents
Culture Documents
SQL3 Output
SQL3 Output
number(5));
Table created
EMPNME
-------------
BBB
EEE
SQL>select count(*) from employee where deptid=(select deptid from department where
deptname=’accounts’);
COUNT(*)
---------------
2
SQL>select min(empsalary) from employee where deptid=(select deptid from department where
deptname=’accounts’);
MIN(EMPSALARY)
---------------------------
40000
SQL>select max(empsalary) from employee where deptid=(select deptid from department where
deptname=’accounts’);
MAX(EMPSALARY)
---------------------------
60000
SQL>select avg(empsalary) from employee where deptid=(select deptid from department where
deptname=’accounts’);
AVG(EMPSALARY)
---------------------------
50000
SQL>select * from employee where deptid=(select deptid from department where supervisor=’www’);
SQL> delete from employee where deptid=(select deptid from department where deptname=’apprentice’;
1 row deleted