how to implement If statement in the select statement

We can implement the if statement in the select statement by using the Decode statement.

Example

     SELECT DECODE (EMP_CAT,'1','First','2','Second'Null);

Here the Null is the else statement where null is done . Here DECODE implement below IF – ELSE logic

                     IF EMP_CAT = ‘1’ THEN
                                  ‘FIRST’ 
                     ELSIF EMP_CAT = ‘2’ THEN
                                  ‘SECOND’
                     ELSE
                                   NULL
                     END IF;

how many types of sql statements are there in oracle

There are basically 6 types of sql statement
Data Definition Language(DDL) - The DDL  statements define and maintain objects and drop objects.
 
Data Manipulation Language(DML) - The DML statements manipulate database data.
 
Transaction Control Statements - Manage change by DML
 
Session Control - Used to control the properties of current session enabling and disabling roles and changing .e.g.,  Alter Statements, Set Role
 
System Control Statements - Change Properties of Oracle Instance .e.g., Alter System
 
Embedded Sql - Incorporate DDL,DML and T.C.S in Programming Language.e.g.,Using the Sql Statements in languages such as 'C', Open,Fetch, execute and close
 

how many Integrity Rules are there

Entity Integrity Rule - The Entity Integrity Rule enforces that the Primary key cannot be Null.
   
Foreign Key Integrity Rule  - The FKIR denotes that the relationship between the foreign key and the primary key has to be enforced.When there is data in Child Tables the Master tables cannot be deleted.
   
Business Integrity Rules - The Third Integrity rule is about the complex business processes which cannot be implemented by the above 2 rules.
   

what does database do during mounting process

During database mount process, Oracle would check for the existence of control files mentioned in init.ora file but it wont check the contents of the control file which is done during the opening of database.

what is the use of redo log information

Redo log information are used to recover database if it get corrupt.

what is the frequency of log updated

  1. COMMIT or ROLLABCK
  2. Time out occurs (3 secs)
  3. 1/3 of Log full
  4. 1 MB of Redo
  5. Checkpoint occurs

Can objects of the same schema reside in different tablespaces

Yes, it can. For example if you specify a different tablespace (B) for indexes, the indexes of the tables that the user create would be residing in B, and the table would reside in the user's default tablespace A.

 

Yes: Schema objects can stored in different tablespace and a tablespace can contained one or more schema objects data.