View (SQL): Difference between revisions

Content deleted Content added
Equivalency: pre instead of code
Line 25:
== Equivalency ==
A view is equivalent to its source query. When queries are run against views, the query is modified. Ie if there exists a vie named Accounts_view and the content is
<codepre>
SELECT name,
money_received,
Line 36:
JOIN accounts_table a
ON a.customerid = c.customer_id
</codepre>
 
The application would simply run a simple query such as:
 
<codepre>
SELECT name,
balance
FROM accounts_view</codepre>
 
The RDBMS then takes the simple query, replaces the equivalent view, then sends the following to the optimiser: