INTEGRITY Enforcing integrity in Oracle. Oracle Tables mrobbert owner granted access.

Slides:



Advertisements
Similar presentations
DB glossary (focus on typical SQL RDBMS, not XQuery or SPARQL)
Advertisements

Introduction to Structured Query Language (SQL)
Introduction to Structured Query Language (SQL)
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
Murali Mani SQL DDL and Oracle utilities. Murali Mani Datatypes in SQL INT (or) INTEGER FLOAT (or) REAL DECIMAL (n, m) CHAR (n) VARCHAR (n) DATE, TIME.
View Sen Zhang. Views are very common in business systems users view of data is simplified a form of security - user sees only the data he/she needs to.
SQL Table Basics. Database Objects Tables Temporary tables (begin with #) Views Keys Indexes.
Introduction to Structured Query Language (SQL)
SQL DDL constraints Restrictions on the columns and tables 1SQL DDL Constraints.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education, Inc. publishing as Prentice Hall 4-1.
CSC 2720 Building Web Applications Database and SQL.
Chapter 4 Relational Databases Copyright © 2012 Pearson Education 4-1.
SQL's Data Definition Language (DDL) – View, Sequence, Index.
Module 9: Managing Schema Objects. Overview Naming guidelines for identifiers in schema object definitions Storage and structure of schema objects Implementing.
SQL Basics. SQL SQL (Structured Query Language) is a special-purpose programming language designed from managing data in relational database management.
Lecture 2 The Relational Model. Objectives Terminology of relational model. How tables are used to represent data. Connection between mathematical relations.
Chapter 9 SQL and RDBMS Part C. SQL Copyright 2005 Radian Publishing Co.
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor Ms. Arwa.
An Investigation of Oracle and SQL Server with respect to Integrity, and SQL Language standards Presented by: Paul Tarwireyi Supervisor: John Ebden Date:
Database Technical Session By: Prof. Adarsh Patel.
Introduction to SQL Steve Perry
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
CODD’s 12 RULES OF RELATIONAL DATABASE
SQL Server 7.0 Maintaining Referential Integrity.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
7 1 Chapter 7 Introduction to Structured Query Language (SQL) Database Systems: Design, Implementation, and Management, Seventh Edition, Rob and Coronel.
Database Design and Management CPTG /23/2015Chapter 12 of 38 Functions of a Database Store data Store data School: student records, class schedules,
6 1 Lecture 8: Introduction to Structured Query Language (SQL) J. S. Chou, P.E., Ph.D.
BIS Database Systems School of Management, Business Information Systems, Assumption University A.Thanop Somprasong Chapter # 7 Introduction to Structured.
IST 220 Introduction to Databases Course Wrap-up.
© 2009 Pearson Education, Inc. Publishing as Prentice Hall 1 Chapter 7 (Part a): Introduction to SQL Modern Database Management 9 th Edition Jeffrey A.
INFORMATION TECHNOLOGY DATABASE MANAGEMENT. Adding a new field 1Right click the table name and select design view 2Type the field information at the end.
Database Systems Design, Implementation, and Management Coronel | Morris 11e ©2015 Cengage Learning. All Rights Reserved. May not be scanned, copied or.
CHAPTER 9 Views, Synonyms, and Sequences. Views are used extensively in reporting applications and also to present subsets of data to applications. Synonyms.
1 SQL - II Data Constraints –Applying data constraints Types of data constraints –I/O constraints The PRIMARY KEY constraints The FOREIGN KEY constraints.
Oracle 11g: SQL Chapter 4 Constraints.
Chapter 4 Constraints Oracle 10g: SQL. Oracle 10g: SQL 2 Objectives Explain the purpose of constraints in a table Distinguish among PRIMARY KEY, FOREIGN.
Database Fundamental & Design by A.Surasit Samaisut Copyrights : All Rights Reserved.
SQL Jan 20,2014. DBMS Stores data as records, tables etc. Accepts data and stores that data for later use Uses query languages for searching, sorting,
AL-MAAREFA COLLEGE FOR SCIENCE AND TECHNOLOGY INFO 232: DATABASE SYSTEMS CHAPTER 7 (Part II) INTRODUCTION TO STRUCTURED QUERY LANGUAGE (SQL) Instructor.
Indexes and Views Unit 7.
Database Management Supplement 1. 2 I. The Hierarchy of Data Database File (Entity, Table) Record (info for a specific entity, Row) Field (Attribute,
SQL/Lesson 7/Slide 1 of 32 Implementing Indexes Objectives In this lesson, you will learn to: * Create a clustered index * Create a nonclustered index.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
Constraints Lesson 8. Skills Matrix Constraints Domain Integrity: A domain refers to a column in a table. Domain integrity includes data types, rules,
Chapter 5 : Integrity And Security  Domain Constraints  Referential Integrity  Security  Triggers  Authorization  Authorization in SQL  Views 
Chapter 4 Indexes. Indexes Logically represents subsets of data from one or more tables View Generates numeric valuesSequence Basic unit of storage; composed.
Creating Indexes on Tables An index provides quick access to data in a table, based on the values in specified columns. A table can have more than one.
SQL Miscellaneous Topics. Views A database view is: – a virtual or logical table based on a query. – a stored query. CREATE VIEW viewname AS query; –CREATE.
Relational Database Management System(RDBMS) Structured Query Language(SQL)
IS6146 Databases for Management Information Systems Lecture 3: SQL III – The DDL Rob Gleasure robgleasure.com.
Chapter 3: Relational Databases
Table Structures and Indexing. The concept of indexing If you were asked to search for the name “Adam Wilbert” in a phonebook, you would go directly to.
Constraints and Views Chap. 3-5 continued (7 th ed. 5-7)
LM 5 Introduction to SQL MISM 4135 Instructor: Dr. Lei Li.
MySQL Tutorial. Databases A database is a container that groups together a series of tables within a single structure Each database can contain 1 or more.
SQL Basics Review Reviewing what we’ve learned so far…….
Lec-7. The IN Operator The IN operator allows you to specify multiple values in a WHERE clause. SQL IN Syntax SELECT column_name(s) FROM table_name WHERE.
1 Section 1 - Introduction to SQL u SQL is an abbreviation for Structured Query Language. u It is generally pronounced “Sequel” u SQL is a unified language.
1 Chapters 19 and 20  Ch. 19: By What Authority? Users Roles Grant and revoke Synonyms  Ch. 20: Changing the Oracle Surroundings Indexes Clusters Sequences.
Getting started with Accurately Storing Data
Rob Gleasure robgleasure.com
Rob Gleasure robgleasure.com
TABLES AND INDEXES Ashima Wadhwa.
Lecturer: Mukhtar Mohamed Ali “Hakaale”
Chapter 4 Indexes.
CH 4 Indexes.
Primary key Introduction Introduction: A primary key, also called a primary keyword, is a key in a relational database that is unique for each record.
Data Model.
CH 4 Indexes.
Presentation transcript:

INTEGRITY Enforcing integrity in Oracle

Oracle Tables mrobbert owner granted access

t Correct data types? Within ranges Any data integrity issues? Is the data correct?

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?

How do we maintain correct, consistent data ? t Data Integrity Rules t Referential Integrity Rules t Business Rules

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

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

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

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

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

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

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)