 |
|
Oracle Tables, Columns
and Views
Oracle Tips by
Burleson
|
Data in an Oracle database resides in tables. A database
typically contains many tables, each of which typically has many
referential integrity links to other tables. There are two types of
elements within tables: columns and rows.
A column is a single data element that contributes to the
structure of a row. All tables must have at least one column; most
have at least four or five columns. The maximum number of columns that
can exist in a table is 255. Each column within the table is given a
datatype.
A row is a group of related data elements in which each item
of the group corresponds to a column. A table typically contains many
rows. In large data warehouses, large tables may contain tens of
millions of rows.
Views
A structure quite similar to a table is a view. Views are
essential SQL queries stored in a database as an object. When a
reference is made to the object, the query is executed and the result
set is returned to the user. Figure 2.5 illustrates the relationship
of a view to its base tables.
The use of views has serious performance implications. While the
views makes SQL and PL/SQL code easier to develop and maintain, there
is significant overhead involved (remember, views are essentially
queries that execute when someone references the view).
Views are often used in systems when a certain functionality
requires a complex join of tables. This is often the case when several
tables must be joined to create the structure of the view, since the
typical user doesn’t have the knowledge needed to join the tables
effectively.
This is an
excerpt from the book "High Performance Oracle Database
Automation" by Jonathan Ingram and Donald K. Burleson, Series
Editor. |