English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2006-07-11 18:41:23 · 5 answers · asked by Jamshaid 1 in Computers & Internet Programming & Design

5 answers

A SQL view is simply a SELECT statement that you save for code reuse.

These are often called virtual tables as the data is not actually physically stored but you can access data through the view.

Once you save the SELECT statement as a view you can SELECT against the VIEW.

EXAMPLE

CREATE VIEW vwSelectActiveClients
AS
SELECT
ClientID,
ClientName,
Status
FROM
tblClients
WHERE
Status = 'Active'

You can then get all active clients by doing

SELECT
*
FROM
vwSelectActiveClients

2006-07-11 18:49:37 · answer #1 · answered by Peter 2 · 1 0

A Database View is a subset of the database sorted and displayed in a particular way. For example, in an equipment database, perhaps you only wish to display the Weapons stored in the database. To do that you would create a Weapons view. The equipment database templates has a view for each equipment type, sorted by the name of the equipment.

For each view, you can control which columns are displayed, what order they are displayed in, how wide each column is, how the data is sorted, and what types of records to display.

A view called "All" is always defined and cannot be deleted. While you can change the sort order of this view, you cannot change which records are displayed. As the name of the view suggests, All records in the database are always displayed by the All view. However, feel free to change the column order or column widths as you'd like.

The rest of this informative article is available at the link I've given you below.

Trust this helps you resolve this issue.

Cheers

2006-07-11 19:30:21 · answer #2 · answered by Anonymous · 0 0

I agree with all that has been explained about a view thus far.. but I think the previous posters missed out on an important aspect of what a view actually is used for.

Assume that you create a set of tables with some purpose in mind. Assume that somewhere down the line, you realised that those table could be collectively used for something else as well.. by now however, your work has increased manifold and you cant sit down and write queries that will do this new thing.. so you want to hire a new guy to do it for you.
Now, you dont want this new guy to really know all that is there in all those tables.. you want him to be only able to see what is relevant to him.. this could be because you dont want to confuse him or that you really dont trust him enough with the new data
So what you can do in this scenario is to create a view, which like someone else mentioned is just a SQL query but once created, for all purposed will be undistinguishable from an actual table..

You can give this new person access to this view while hiding the rest of the tables from him.. and he can go ahead and use this view henceforth.

This data hiding is a foundation to having a view. You see what you need to!

Hope this helps

2006-07-11 19:23:04 · answer #3 · answered by Neil 5 · 0 0

Spreadheet view
report view
create view
form view


They are the way the database appears in your window. The spreadsheet view looks like an excel type form, the report view can be set up to present your data in a report, the form view is how the actual form looks to the person entering the data and the create or design view is the window in which you can design and add parameters to your form.

2006-07-11 18:48:57 · answer #4 · answered by pknutson_sws 5 · 0 0

view is logical representation of data. It can be obtained from one or more than one than one table.

2006-07-11 18:48:55 · answer #5 · answered by Altafur R 1 · 0 0

fedest.com, questions and answers