Classic format of select basic composition
select * from emp;
select * from emp where empno>8000;
select empno ename sal comm from EMP where Sal < comm
select Deptno count (*) from emp group by Deptno ;
select Deptno sum ( sal ) Total_sal from EMP where job = ' MANAGER ' group by Span class= "PLN" > Deptno ;
select job count ( distinct deptno ) from EMP where Mgr is not null group by Span class= "PLN" > Job order by job ;
select job count ( distinct deptno ) from EMP where Mgr is not null group by Span class= "PLN" > Job order by count ( distinct deptno ) desc job
select job count ( distinct deptno ) Uniq_deptno Span class= "KWD" >from emp where Mgr is not null group by job Order by Uniq_deptno desc job ;
select deptno, to_char(hiredate,‘yyyy‘),count(*) from emp group by deptno,to_char(hiredate,‘yyyy‘);
Sorting is very resource-intensive, so it is the last execution, and you should keep this in mind.
Here's a look at a demand.
From for notes (Wiz)
Code Word SQL (2)