The following are Select (interactive) statement examples:
select e.ename
from employee e, dept, employee m
where e.dept = dept.dno and dept.mgr = m.eno
and e.salary > m.salary;
select * from employee
where salary > (select avg(salary) from employee);
select e.ename, d.dname from employee e, dept d
where e.dept = d.dno
order by dname, ename;
select * from samples s
here s.lab = 12
union
select * from archived_samples s
where s.lab = 12
select dbmsinfo('username');
select dow(date('today') + date('3 days'));
select e.ename from employee e,
(select avg(e1.salary), e1.dno from employee e1 group by e1.dno) e2(avgsal, dno)
where e.dno = e2.dno and e.salary > e2.salary;
This query can alternatively be coded as:
select e.ename from employee e,
(select avg(e1.salary) as avgsal, e1.dno from employee e1 group by e1.dno) e2
where e.dno = e2.dno and e.salary > e2.salary;