Database - Oracle

Introduction to Oracle

1. sqlplus connects to remote Oracle commands

sqlplus (environment variables need to be set) scott (username)/5456 (password)@192.168.230.128:1521 (IP)/orcl (database name)

2. View the current user

show user -- sqlplus command

3. View the table under the current user

select * from tab;

4. Execute the previous SQL statement

/ -- sqlplus command

 

table operations

1. View the structure of the employee table

desc emp;

2. Query the data in the employee table

select * from emp;

3. Query the employee number, name, monthly salary, and annual salary in the employee table (monthly salary*12)

SELECT EMPNO,ENAME,SAL,SAL*12 FROM EMP;

4. Query the employee number, name, monthly salary, annual salary (monthly salary*12), bonus, annual income (annual salary + bonus) in the employee table

SELECT
	EMPNO,
	ENAME,
	SHALL,
	SAL * 12,
	COMM,
SAL * 12 + COMM
FROM
	EMP;

  

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325160271&siteId=291194637