Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

The difference between a 'view' and 'base' relation

Tags:

database

rdbms

What is the difference between a 'view' and 'base' relation in database systems?

like image 707
keyur Avatar asked Aug 25 '09 13:08

keyur


People also ask

What is a view relation?

Explanation: A relation that is not a part of the schema but is a virtual relation is called as view. Views improve writability as viewing the entire logical model is not feasible.

What's the difference between a view and a table?

A view is a database object that allows generating a logical subset of data from one or more tables. A table is a database object or an entity that stores the data of a database.

How can you tell the difference between an index and a view?

A view is just a way of abbreviating a subquery. An index is used to optimize matching column data.

What is the relationship between a database table and a user view?

A table is structured with columns and rows, while a view is a virtual table extracted from a database. The table is an independent data object while views are usually depending on the table.


2 Answers

A base relation (table) actually contains data. A view is a query over one (or more) base relations but does not actually contain any data itself.

like image 109
Eric Petroelje Avatar answered Nov 15 '22 08:11

Eric Petroelje


A base relation is just a table that actually physically exists and is stored in the database.

This is in contrast to a view, which is derived from base relations but does not actually physically exist in the database - it only exists as a structural definition, pulling its data from a number of base relations.

like image 33
hussanain Avatar answered Nov 15 '22 08:11

hussanain