You don't always need to see an entire table. In fact, a table may contain data (like salary information) that shouldn't be seen by everyone.
You may also frequently want to see two or more tables together.
In these situations, the systems administrator creates a view.
What is a View
A view is defined using DDL and can be:
A view is represented internally by a stored command, not stored data. A view can display data from one or more tables or from other views.
Each view has a name, just as a table has a name. You can use all SQL SELECT commands that you use against a table against a view as well.
When you display the view, you see only the subset of columns and rows specified in the view definition.
Here is a table and one view of it:
POSITION ┌────────┬────────┬───────────────┐ │EMP_ID │JOB_ID │SALARY_AMOUNT │ ├────────┼────────┼───────────────┤ │2096 │4666 │42640 │ │ │ │ │ │2437 │4560 │21944 │ │ │ │ │ │2598 │2053 │13520 │ └──┬─────┴──┬─────┴───────────────┘ └──────┐ └──────┐ │ │ POS_INFO │ │ ┌───▼────┬───▼────┐ │EMP_ID │JOB_ID │ ├────────┼────────┤ │2096 │4666 │ │ │ │ │2437 │4560 │ │ │ │ │2598 │2053 │ └────────┴────────┘
|
Copyright © 2014 CA.
All rights reserved.
|
|