Professional Documents
Culture Documents
Correlated subquery => subquery is executed once for every row produced by the
outer query.
Multiple row subquery operator should be prefixed with any of the single –row
comparison operator.
Multiple row subquery operators
<ANY => <MAX
>ANY=> >MIN
=ANY => Same as the IN operator
>ALL => >MAX
<ALL => <MIN
Other Database Objects
Views
Sequence
Synonyms
Index
Views
A logical table which is a combination of one or more table.
Advantages:
Restrict database access
To make complex queries easy
To provide data independence
To present different views of the same data
Types of Views
Simple view => only one base table
=> DML possible through view
Syntax:
To drop a synonym:
Drop synonym synonym_name
Index
Speeds up the retrieval of rows by using pointers
Reduces Disk I/O.
Types:
Unique Index => Automatically created
Non-Unique Index => Manually created.
Syntax:
Create index <indexname> on <tablename>(columnname);
Drop index:
Drop index <indexname>;
FlashBack
Flashback query allows a user to view the data quickly and
easily the way it was at a particular time in the past, even
when it is modified and committed, be it a single row or the
whole table.
Flashback technologies are applicable in repairing the
following user errors.
Erroneous or malicious DROP TABLE statements
application errors
Configuration before using Flashback Queries