Monday, November 28, 2011

VIEWS:


            CREATE VIEW CVIEW(VCNO,VCNAME,VCLOC) AS
                           (SELECT CNO,CNAME,CLOC FROM CUST WHERE
                                                                                       CNAME LIKE “%X%)

Ø  Logical representation of the table
Ø  Stored in virtual memory
Ø  Can be derived from single table or multiple tables
Ø  Views are updateable if they are derived from single table without any column functions , group by
Ø  Multiple views can be generated from single table.
Ø  Views are stored in sysviews

Advantages of Views:

Ø  Data security
Ø  Data correctness
Ø  Logical data independence
Ø  Part of the information can be visible to the sers
Ø  Accessing can be faster.
DELETE RULES:

Ø  Delete rules can be applied for delete command against Database.
Ø  Delete rules are 3 types
1.      on delete cascade – all matching child rows will be deleted automatically when we delete parent row.
2.      on delete restrict – all matching rows will be restricted when we delete parent row which is default.
3.      on delete set null – all matching child row will be set to null when we delete parent row.

No comments:

Post a Comment