Clear Screen
Host CLS;
View Current User
Show user;
Tables under the current user
SELECT * from tab;
tab data Dictionary
DESC EMP;
Find information for all employees
SELECT * from EMP;
Querying by Column name
Select Empno,ename,job,sal from EMP;
Query employee number, name, salary, annual salary
Select empno,ename,sal,sal*12 from EMP;
Query employee number, name, salary, annual salary, annual income
Select Empno Employee number, ename name, Sal monthly salary, sal*12 annual salary, Comm Bonus, Sal*12+comm annual income from EMP;
Select Empno Employee number, ename name, Sal monthly salary, sal*12 annual salary, NVL (comm,0) bonus, SAL*12+NVL (comm,0) annual income from EMP;
Select Comm is empty
Select*from EMP where comm is null;
Distinct to remove duplicate records
Select Deptno from EMP;
SELECT DISTINCT deptno from EMP;
Select Job from EMP;
SELECT distinct job from EMP;
SELECT distinct deptno,job from EMP; Deptno and job combinations are not duplicated.
Select concat (' Hello ', ' world ') from EMP;
Select 3+2 from dual;
Select ' Hello ' | | ' World ' from dual;
Select Ename| | ' The salary is ' | | Sal
Oracle Basic Query Content collation