Oracle knowledge summary

1, orcale case insensitive, identifiers (table name, column name, alias, etc.) is case-sensitive; designator no double quotes, performed automatically by default converted to uppercase
2, orcale acting in double quotes: Escape Illegal identifier is valid, the forced execution flag original case
3, oracle is not constant in that said date type, default date string format Mon-RR-dd
. 4, Oracle null value and any value for the comparison operation is false a certain result, no oracle database Boolean values true and false
5, in (list of values): If any of the values in the list of expressions equal value, it is true; not in (values list): expression any value in the list is not equal to the value , it is true
6, like: fuzzy logic queries not like non-wildcard to 0% represents any number of characters _ on behalf of an arbitrary character
7, sorting clause: order by asc ascending sort expression (not written by default) desc descending sorting operation is very resource-intensive, large amounts of data sorting, optimization of the database must be prepared in advance
8, single function, each execution function, passing a row value, returns a result; multi-line function, every time OK function, multi-pass line value, returns a result
9, RDBMS relational database management system: the core is the relationship between the table and the table
master table: Table data is referenced
from the table: reference data from the main table
primary key: main uniquely identifies a column in the table, the primary key value can not be repeated, can not be null
foreign key: references that primary key data from the primary table, foreign key values can be repeated, or may be empty, you must be the primary key column references present in value
three relationships between tables and tables:
one to many: one record in the primary table corresponds to the plurality of records from table
one: one record from the table is a record in the primary table
Many-: a plurality of records corresponding to a table of a plurality of records of another (cohesion must be through the intermediate sheet, formed by two indirect-many relationship)
10, three database design paradigm:
the first paradigm: column integral ( data columns must be clear, not a list of up to two data)
second Pattern: table must have a primary key identifier
third paradigm: the main reference table can not appear in the non-primary key column from the table
11, SQL99 join queries, efficiency ratio 92 syntax high
internal connection: inner join, only query the data meet the join condition (default)
outer join: query data connections to meet the conditions, the data connection does not meet the conditions of return also
left outer join: left outer join
outer connection: right outer join
full outer join: full outer join
join condition: on connection of conditional expression
from the connection: the two tables as a table
12, the packet function
sum sum, avg averaging, max selecting the maximum value, min for the minimum, count count
13, a subquery: query contains query, also referred to as a nested query, a subquery main query (outer query query), if they are available subqueries Join queries implemented to make use of join queries, high efficiency, subquery must be written in parentheses, try to write on the right conditions, to improve efficiency
14, any: logic, or, for example,> any; all: logic, e.g.> All
15, standard subqueries correlated subquery (interactively related and outside subquery)
execution order subquery to the main query emperor first query, the subquery
using data of the main uses a subquery to the main query and the results of each query result subquery
performs a number of executions the number of rows in the result set of a query execution times = primary
16, exists (subquery): If the query results are known, return true, otherwise return false; not exists (subquery): If the sub-query results are known, it returns false, otherwise it returns true
17, DML statements: data manipulation language, insert, delete, modify table data
is inserted into a single row: insert into table [(column 1, column 2, ......)] values (value 1, value 2, ......) All values must be the number, order, type consistent omitted column list, the default is that all the columns
multiple rows inserted: the results of a sub-query is inserted directly into another table, insert into table [(column 1, column 2, ......)] subquery
modify data: primary key value has been generated, the latter are not allowed to modify, update table set column = value 1, column 2 = value, ...... [where clause]
to delete the data: delete from table [where clause]
18, data transaction transaction: to ensure the integrity of an operation either succeed together or do not perform
the transaction four ACID properties:
atomic: put a practical operation must be a full operation, either succeed together, or none of them perform
consistency: must be correct from a direct transition to the next state a positive Indeed state
isolation: a session can not access the data (dirty) did not submit another session
persistence: Once the transaction is committed, the data changes directly persisted to the database, you can access other sessions, you can not roll back
the beginning of the transaction: any one DML will open a new transaction
ends the transaction:
the transaction is committed:
the commit statement
DDL, DCL statements actually commit
the normal exit client tools (such as command-line exit to exit)
back the transaction:
ROLLBACK statement
Client Tools abnormal exit
19, the lock mechanism: Avoid concurrent user access to data, after the end of the transaction lock to release
the lock divided according to size: row-level locking and table-level locking
locks divided by type:
shared lock (s lock): If a resource (rows, tables) together with a shared lock, other sessions can also add to the resources shared lock, but can not add an exclusive lock
exclusive lock (x lock, exclusive lock): If a resource (line, table) plus an exclusive locks, other sessions can not be added to the resources of any lock
lock in the locked mode split: automatic lock and manual lock
automatic locked:
query: default without any lock
DML statements: the line exclusive lock, lock the table to share
DDL statements: table exclusive lock
manual locking:
query lock: query for update; (row exclusive lock, shared lock table, it will open a transaction like the same DML)
to manually lock table:
optimistic locking: lock table table name in share mode;
pessimistic locking: lock table table name in exclusive mode;
deadlock: two sessions of each other waiting for the other transaction to release the lock in order to proceed down
20, DDL (data Definition language): create (create tabl e), modified (alert table), delete (drop table) database object
classification data tables: user tables and system tables (data dictionary)
user table: data tables users to create their own
system table (data dictionary): database itself create a maintenance and system information is stored
empty table delete truncate
can not be rolled back rollback
tombstone physically deleted
Logging not logging
21, constraint: restrictions DML operations on the table, the constraints may be created table added simultaneously, can table after creating additional
not null: not null constraint
primary key: primary key constraint, limiting the primary key column values can not be null and can not be repeated, a table can have only one primary key, a master key is composed of multiple columns
unique: a unique value constraint, limiting column values can not be repeated, is not limited null value, a table can have multiple unique values constraint
check: check constraints, limits column values meet custom criteria, ignore blank check, a null value is not checked
foreign key: foreign key constraints limit the foreign key column values must be the primary table referenced primary key column present value of
the additional constraint
alter table table
add bound by a particular set constraints:
foreign key cascade delete: to delete the master table data is automatically deleted from the table referenced data
key blanking outer cascade: delete the primary concatenated reference table data automatically from the foreign key is null table
22, view : saved data is not real, but the query (unless it is a physical view, the saved data is real)
role: controlling user access, simplify some Complex queries
create view object: there must create view permission, if there is derived columns query view, must play an alias
create or replace view view name
as
a query
physical view: storage of physical data, you need to refresh manually program synchronization data
23, the sequence: number increment automatically generated, is mainly used to generate the primary key value
24, Index: accelerate query speed: DML but will reduce the speed, default conditions to do is retrieve the full table scan, index creation are the default B-TREE index for the column base is relatively high
RBO rule-based optimizer : If the column has an index, the query would take the index, the index even go more slowly, will take the index
CBO CBO based: the database can only judge whether they should take the index, if the index does not go faster, then there will not be indexed taking the index, do a full table scan (oracle default)
for creating an index of empty:
1, column base is relatively high (rarely repeat value)
2, conditions do not null, null null index for the query
3, column values often as a condition of the query
4, a large amount of data tables
5, regular query, rarely do DML operations
6, satisfy the query data does not exceed 15% of the total record of
7, taking the index is not fuzzy query, fuzzy query if want to improve efficiency you must use the full-text search technology
25, synonyms: name aliases to the object, simplifying the object
26, DCL: user rights management
authorization statement: grant permissions 1, permission 2, ...... to User;
take-over statement: revoke a permission, permission 2, ...... from the user;
27, SET set operations: a plurality of query results union, intersection, and complement operations, the plurality of query results must be the number of columns, sequence consistent with the type
and set union (automatically eliminate duplicate rows)
and set union all (without eliminating duplicates)
the intersection intersect
complement minus

original: https://blog.csdn.net/zzw811131619/article/details/83342818
Oracle Advanced articles: https://blog.csdn.net/whandgdh/column/info/26514/2

Guess you like

Origin www.cnblogs.com/aaronRhythm/p/11289659.html