Subscribe to Subscribers

Online Members

Spha
Meera
More...

Forums » .NET » ASP.NET »

Diff b/w table and view


Posted Date: 20 Jan 2010      Posted By:: Dhilip     Member Level: Gold    Member Rank: 652     Points: 1   Responses: 5



Dear all,
what is the differene between table and view.give me with some examples.


Regards,
Dhilip




Responses

#465316    Author: Girish Dindukurthy      Member Level: Gold      Member Rank: 959     Date: 20/Jan/2010   Rating: 2 out of 52 out of 5     Points: 2

Table : Relational Database is composed of tables that contain related data.

View :

1. Views are created from one or more than one table by joins with selected columns.

2. Views acts as a layer between user and table.

3. Views are created to hide some columns from the user for security reasons and to hide information exist in the column.

4. Views reduces the effort for writing queries to access specific columns every time.

5. Reports can be created on views.

6. View doesn't contain any data.


 
#465329    Author: Asheej T K        Member Level: Diamond      Member Rank: 2     Date: 20/Jan/2010   Rating: 2 out of 52 out of 5     Points: 2

A table is where you store your data and it occupies space on disk.

View is a virtual table.


Regards,
Asheej T K
Microsoft MVP[ASP.NET/IIS]
DotNetSpider MVM

Dotnet Galaxy


 
#465333    Author: Alwyn Duraisingh        Member Level: Gold      Member Rank: 10     Date: 20/Jan/2010   Rating: 2 out of 52 out of 5     Points: 2

Table sample:


CREATE TABLE Employee(ID INT, Name VARCHAR(100))


In a table, we can do all data manipulations like select, delete, update and insert.

View sample:


CREATE VIEW Employee
AS
SELECT ID, NAME FROM Employee
GO


In view we can only read the data, we can't perform Insert, Update and Delete.

Please mark this as Answer, if this helps

Regards,
Alwyn Duraisingh.M 
<< Database Administrator >>
Jesus saves! The rest of us better make backups...





 
#465344    Author: Kolan      Member Level: Gold      Member Rank: 59     Date: 20/Jan/2010   Rating: 2 out of 52 out of 5     Points: 2

View is a virtual table where as a table is where you store your data and it occupies some space in disk.

 
#465576    Author: Christopher F      Member Level: Gold      Member Rank: 172     Date: 20/Jan/2010   Rating: 2 out of 52 out of 5     Points: 2

A Table is a repository of data, where in the table itself is a physical entity. The table resides physically in the database.

A View is not a part of the database's physical representation. It is precompiled, so that data retrieval behaves faster, and also provide a secure accessibility mechanism.

See code example below:

Create table T_EMPLOYEE
(Emp_Id integer primary key,
Name varchar2(50)
Skillset varchar2(200),
Salary number(12,2),
DOB datetime);

Say there is a scenario where Salary is not to be shown to a group of users, a View may be created to display allowable information:

Create view EMP_SOME_DETAILS
as
(Select Emp_Id, Name, Skillset, DOB
From T_EMPLOYEE);

The advantages of using a view are as follows:
- It may access data from a table, multiple tables, view, multiple views, or a combination of these
- A view connects to the data of its base table(s).
- Provides a secure mechanism of data accessibility

Synonym is alternate name assigned to a table, view, sequence or program unit.
- It may be used to shadow the original name and owner of the actual entity
- Extends the reach of tables, by allowing public access to the synonym


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : Priorities
Previous : Gridbind
Return to Discussion Forum
Post New Message
Category:

Related Messages

Awards & Gifts
Talk to Webmaster Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India
2005 - 2013 All Rights Reserved.
.NET and other trademarks mentioned in this site belong to Microsoft and other respective trademark owners.
Articles, tutorials and all other content offered here is for educational purpose only.
We are not associated with Microsoft or its partners.