What is the purpose of a view???? How do I use it??? And is it only available in Mysql 5.0???
Printable View
What is the purpose of a view???? How do I use it??? And is it only available in Mysql 5.0???
views are many different things depending how they are used.
the most basic explanation is that a view is another database strucutre, much like a table, that when queried returns rows from the table or set of tables from a pre-defined query. So a view is basically a pre-defined SQL statement that acdesses a set of tables.
for instance a view is created by :
create view my_view as select a.*, b.* from a, b where a.id = b.id
the use of views can be for simplicity (not having to remember the underlying SQL) or as a security measure to hide specific columns from a table from a set of users.
for instance you may have a view the calculates and returns a bonus for each employee. but you may not want to allow users to see the pay rate or salary of each employee.
hope this helps.
View is available in most rdbms except earlier version of MySql.