| |
 |
|
Oracle Tips by Burleson |
Database Objects
Everything in an Oracle database is an object,
from tables to queries. In the last chapter, we introduced you to
creating and managing tables; however, there are many other objects in
the database. In this chapter, we are going to extend your knowledge
of tables by integrating constraints. Constraints protect your data
and include primary and foreign keys. They enforce uniqueness and
check data before inserting it into a table. We will then discuss
views and materialized views, and how they differ from tables and when
they are used. Next, we will show you how to use indexes to make your
queries more efficient.
All of these objects play an important part in
protecting your data, while enhancing the database’s efficiency.
Let’s start our discussion in the last chapter on tables, with some
details on integrity constraints.
Integrity Constraints
Constraints protect the integrity of your data.
Most DBAs look at constraints as rules attached to a table; however,
they are separate objects within the database. They are applied
whenever data is added or changed in a table or when the constraint is
enabled. Since they are separate objects, they can be disabled or
enabled individually. When a constraint is disabled, it remains in
the database but is not used to validate data, allowing possibly
invalid data to be placed in the table. Some constraints are used to
insure that the tables can be related on keys.
The above text is
an excerpt from:
Easy Oracle SQL
Get Started Fast Writing SQL Reports with SQL*Plus
ISBN 0-9727513-7-8
by
John Garmany
 |
For more details and scripts, see my new book "
Oracle
Tuning: The Definitive Reference", over 900 pages
of BC's favorite tuning tips & scripts.
You can buy it direct from the publisher for 30%-off and get
instant access to the code depot. |
|