SQL Structured Query statement:
$ sqlplus/as sysdba into SQL as administrator under Oracle User
sql> alter user HR account unlock identified by HR; Unlock HR Users
Sql> Show user shows current administrator status
Sql> DESC Employees Show all columns of employees
Full screen editing function with Sqlplus:;
Sql> Ed
Go to full screen edit equivalent VI editor
Enter SQL command, save after exiting
sql>/execution
SQL Base query:
Query statements each query is the intersection of rows and columns
Filter criteria for Select Columns * represents all Columns
from which table
Row of the where row's filter condition Plus condition example id=90
Base SELECT statement:
Sql> SELECT * FROM Employees;
Sql> DESC Employees
Sql> Select Last_Name, SALARY, commission_pct from employees;
Sql> DESC Departments
Sql> Select department_id, department_name from departments;
spaces are aliased after the columns of the query :
Select salary,12*salary* (1+commission_pct) total wage from employees; The total salary is the alias of salary,12*salary* (1+commission_pct).
To construct a statement using hyphens:
Output the following employee information:
EmployeeID is ... at department. Total salary are ...
Select ' Employee name is ' | | last_name| | ' The department is ' department_id '
From Employees
where;
11th Day SQL