Concept:
A view is only a select statement, which is fully logical and non-physical. It is also called a virtual table. Secure, convenient, and consistent
Case 1: Create a view
Create or replace view myview
As
Select * from qwe;
Case 2 call View:
Select * from myview
To insert or modify a view file, you must have the corresponding permissions. Modify the view to modify the real table. The view is only select! When a view is composed of two or more tables, we cannot simultaneously operate the two tables. The read-only view with read only (with check option ), or when the restrictions include groupby and distinct (Aggregate functions), they cannot be updated.
Synonym: Sa. dept, that is, [user. Object]
Case 1: Create synonyms and delete Synonyms (unique synonyms and public synonyms ).
Create SYNONYM deptfor sa. dept -- proprietary. It takes effect only when the Creator logs on.
Drop SYNONYM dept -- delete a SYNONYM
Create publicSYNONYM dept for sa. dept -- public. All users can use this synonym.
Case 2: synonyms
Select * fromdept; -- synonym defined above
Sequence:
Concept: it is an independent transaction that can be incremented or decreased one by one. Able to control step
Case 1: Create a sequence
Create sequence kk1 -- create a sequence
Start with 1 -- the start value is 1.
Increment by 2 -- step is 2
Order -- Increment
Nocycle; -- non-circular
Case 2: Change Sequence
Alter sequence kk1 -- change the sequence
Increment by 4; -- change the Incremental Value
Case 3: Application Sequence
Select kk. nextval from dual; -- view the next value of the sequence
Select kk. currval from dual; -- view the current value of the sequence
Case 4: insert Table sequence by sequence incrementing. nextval
Insert into qwe values (kk. nextval, 'A ');
Insert into qwe values (kk. nextval, 'A ');
Insert into qwe values (kk. nextval, 'A ');
Insert into qwe values (kk. nextval, 'A ');
Insert into qwe values (kk. nextval, 'A ');
Insert into qwe values (kk. nextval, 'A ');
Insert into qwe values (kk. nextval, 'A ');