Download presentation
Presentation is loading. Please wait.
1
INTEGRITY Enforcing integrity in Oracle
2
Oracle Tables mrobbert owner granted access
3
t Correct data types? Within ranges Any data integrity issues? Is the data correct?
4
Is the data consistent? t Is the data consistent between tables? t Are the same values equivalent t Do foreign keys reference existent primary keys t Has logical consistency been maintained?
5
How do we maintain correct, consistent data ? t Data Integrity Rules t Referential Integrity Rules t Business Rules
6
Where do we place the constraints? n Base Tables – Constraints which always apply – Will always be enforced by DBMS n Views – Structure to meet needs – Only enforced when data accessed through view n Front end tool –more constraints avaiable –easier to fomrulate –only enforced if tool is used –lack of centralized control
7
Base Tables CREATE TABLE Command makes base tables base tables is data structure stored on DASD All columns must have unique name Primary key not always required syntactically but needed to establish relationships SQL verifies syntax availability of tablespace uniqueness of name creator has proper authorization
8
VIEWS n Virtual Table - Logical representation of another table or combination of tables. n CREATE VIEW viewname AS (SELECT...) n Usage –provide security –hide data complexity –reduce syntactic complexity –present different perspective
9
Operations on Views n Query –Standard select statement n Insert n Delete n SOME views may be used for updating –single table with view containing primary key –all not null fields included in view –views created from joining multiple tables usually do not permit updates
10
SQL DDL n CREATE SEQUENCE –sequential values –CREATE SEQUENCE seqname INCREMENT BY 1 START WITH 1000 –INSERT INTO tablename VALUES (..., seqname.NEXTVAL,...) n DROP SEQUENCE, DROP INDEX, DROP VIEW
11
Index n performance enhancer n CREATE INDEX indexname ON tablename (column) n Single or multiple indexes on a table through the selection of one or many columns containing unique data values. n Concatenation of columns to assure uniqueness
12
Index con’t n Indexes automatically maintained and used by system n Trade off - access time vs update time n Unique index –CREATE UNIQUE INDEX indexname ON tablename(attribute)
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.