Home arrow Site Administration arrow Page 7 - Database Essentials

Room With A View - Administration

Are you new to the wonderful world of databases? Confused by thesudden flood of technical jargon? Don't know the difference between a"trigger" and a "stored procedure", a "join" and a "subquery"? Look nofurther - the solution is right here!

TABLE OF CONTENTS:
  1. Database Essentials
  2. The Customer Is King
  3. Relationships
  4. Invasion Of The Foreign Keys
  5. Looking Up The Index
  6. Joined At The Hip
  7. Room With A View
  8. Pulling The Trigger
  9. So That's Where All My Money Went...
By: icarus, (c) Melonfire
Rating: starstarstarstarstar / 7
February 26, 2001

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement
Closely related to joins and subqueries is the concept of "views", which offers yet another way of displaying specific data slices.

Unlike joins and subqueries, which are based on actual database tables, a view is a table derived from the content present in other tables. Think of a view as a virtual table, one which contains values from other tables (these values selected on the basis of user-defined rules), and which can be manipulated in exactly the same way as a regular table.

Since a view is based on the data present in "real" tables, the data you see in the view changes as the data in the base tables changes. A view also provides a simple way to restrict access to sensitive fields in a database table, allowing you to exclude certain fields from display, and can be used in combination with joins to discover new relationships between different data items.

For example, the following command creates a view named "highRollers", which only contains a list of accounts with a balance in excess of $1000.00

sql> CREATE VIEW highRollers AS SELECT CustomerID FROM balance WHERE AccountBalance >=1000.00;

And now, when you display the contents of the "highRollers" view, this is what you'll see:

sql> SELECT * FROM highRollers; +------------+ | CustomerID | +------------+ | 734736 | | 234673 | +------------+

Any changes made to the "customers" table will be immediately reflected in the view; similarly, changes made to the data in the view will be executed on the underlying table.

 
 
>>> More Site Administration Articles          >>> More By icarus, (c) Melonfire
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

SITE ADMINISTRATION ARTICLES

- Coding: Not Just for Developers
- To Support or Not Support IE?
- Administration: Networking OSX and Win 7
- DotNetNuke Gets Social
- Integrating MailChimp with Joomla: Creating ...
- Integrating MailChimp with Joomla: List Mana...
- Integrating MailChimp with Joomla: Building ...
- Integrating MailChimp with Joomla
- More Top WordPress Plugins for Social Media
- Optimizing Security: SSH Public Key Authenti...
- Patches and Rejects in Software Configuratio...
- Configuring a CVS Server
- Managing Code and Teams for Cross-Platform S...
- Software Configuration Management
- Back Up a Joomla Site with Akeeba Backup

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: