SQL 2008 Essentials

Page 212

6.3

DERIVED STRUCTURES

197

This produces the following output (note that the third name has changed): names -------------------Sumon Bagui Sudip Bagui Mala Saha Ed Evans Genny George (5 row(s) affected) 5. Then view the contents of the underlying table by selecting all rows in

the table (and note that the third name in this table has changed): SELECT * FROM Employee This now gives: names -------------------Sumon Bagui Sudip Bagui Mala Saha Ed Evans Genny George

wage --------------------10.00 15.00 18.00 NULL 20.00

hours -----40 30 NULL 10 40

(5 row(s) affected) If a row were added or deleted from the Employee view view, the same change would also appear in the underlying table. When adding, changing, or deleting data in views, you should always be very careful because you may not want to change the original underlying table.

6.3.1.6.2 Changing Data in Tables If data is changed in the original table, such as Employee, the same data in all the views related to this underlying table also gets changed.


Issuu converts static files into: digital portfolios, online yearbooks, online catalogs, digital photo albums and more. Sign up and create your flipbook.