Regarding : Views Concept in Mysql

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • santhanalakshmi
    New Member
    • May 2009
    • 147

    Regarding : Views Concept in Mysql

    hi,

    I want to know Some "Views Concept ".Now only,i am learning "View Concept".


    1. what is the main use of "VIEWS" ? (using in mysql)

    2.I try some queries using "VIEWS".I am creating a new View table with a Select query using more than one table. As per rule,it doesn't get updated in "View Table" as well as from the "base table"(using table in select query)

    Code:
     For Example :create view customers_view(cid,name,salary) as select a.cid,a.name,b.salary from customers a,orders b where a.cid=b.cid;


    now :View Table is Created.

    Then : I am trying to update the values in the View Table ....its get updating.The values should not get update if we are using more than one table in the select query..Did i following correctly.


    Its get updating in the "Base Table also".Please tell me out.Thanks in advance
  • shabinesh
    New Member
    • Jan 2007
    • 61

    #2
    views are just like tables(virtual tables) in database but will not really exist in the disk. Views are useful when you want to group columns from different tables or create view under certain conditions and perform usual table operations on it.

    you can update a view(restrictio ns apply)!! views are not independent and is just a part of a tables.

    mysql doc says: You cannot use UPDATE to update more than one underlying table of a view that is defined as a join. here

    Comment

    Working...