Chapter 12Introduction to Oracle9i: SQL1 Chapter 12 Additional Database Objects.

Slides:



Advertisements
Similar presentations
9 Creating and Managing Tables. Objectives After completing this lesson, you should be able to do the following: Describe the main database objects Create.
Advertisements

Creating Tables. 2 home back first prev next last What Will I Learn? List and provide an example of each of the number, character, and date data types.
Chapter Thirteen Sequences Dr. Chitsaz Objectives: Sequence objects Create and use sequences Application of sequences.
Copyright  Oracle Corporation, All rights reserved. 10 Creating and Managing Tables.
11-1 Copyright © Oracle Corporation, All rights reserved. Different type of keys.
Database Programming Sections 13. Marge Hohly  1. Which statements are True about the following sequence? The sequence was used to generate numbers.
10 Copyright © 2004, Oracle. All rights reserved. Creating Other Schema Objects.
Introduction to Structured Query Language (SQL)
A Guide to Oracle9i1 Advanced SQL And PL/SQL Topics Chapter 9.
Copyright س Oracle Corporation, All rights reserved. 13 Other Database Objects.
A Guide to MySQL 7. 2 Objectives Understand, define, and drop views Recognize the benefits of using views Use a view to update data Grant and revoke users’
Introduction to Structured Query Language (SQL)
Introduction to Oracle9i: SQL1 Views. Introduction to Oracle9i: SQL2 Chapter Objectives Create a view, using CREATE VIEW command or the CREATE OR REPLACE.
Using SQL Queries to Insert, Update, Delete, and View Data © Abdou Illia MIS Spring 2015 Wednesday 1/28/2015 Chapter 3A.
SQL's Data Definition Language (DDL) – View, Sequence, Index.
Chapter 6 Additional Database Objects
Constraints  Constraints are used to enforce rules at table level.  Constraints prevent the deletion of a table if there is dependencies.  The following.
13 Other Database Objects Important Legal Notice:  Materials on this lecture are from a book titled “Oracle Education” by Kochhar, Gravina, and Nathan.
Objectives After completing this lesson, you should be able to do the following: Categorize the main database objects Review the table structure List.
Dr. Chen, Oracle Database System (Oracle) 1 Chapter 6 Additional Database Objects (up to p.195 and all in the pptx file) Jason C. H. Chen, Ph.D. Professor.
Copyright © 2004, Oracle. All rights reserved. Lecture 3: Creating Other Schema Objects Lecture 3: Creating Other Schema Objects ORACLE.
Oracle Database Administration
12 Copyright © Oracle Corporation, All rights reserved. Other Database Objects.
Other database objects (Sequence). What Is a Sequence? A sequence: Automatically generates sequential numbers Is a sharable object Is typically used to.
11 Copyright © 2007, Oracle. All rights reserved. Creating Other Schema Objects.
Set operators The set operaotrs combine the result of two or more component queries into one result. queries containing set operators are called compound.
Chapter 6 Additional Database Objects Oracle 10g: SQL.
Chapter 5 Sequences.
10 Copyright © 2009, Oracle. All rights reserved. Using DDL Statements to Create and Manage Tables.
About the Presentations The presentations cover the objectives found in the opening of each chapter. All chapter objectives are listed in the beginning.
10 Creating and Managing Tables Objectives At the end of this lesson, you will be able to: Describe the main database objects Create tables Describe.
Database Programming Sections 11 & 12 – Creating, and Managing Views, Sequences, Indexes, and Synonymns.
Copyright  Oracle Corporation, All rights reserved. 10 Creating and Managing Tables.
ITBIS373 Database Development Lecture 3a - Chapter 3: Using SQL Queries to Insert, Update, Delete, and View Data.
CHAPTER 9 Views, Synonyms, and Sequences. Views are used extensively in reporting applications and also to present subsets of data to applications. Synonyms.
Chapter 9 Constraints. Chapter Objectives  Explain the purpose of constraints in a table  Distinguish among PRIMARY KEY, FOREIGN KEY, UNIQUE, CHECK,
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 Programming Sections 11 & 12 –Sequences, Indexes, and Synonymns.
George Mpopo | Rosebank College ADVANCED DATABASES WITH ORACLE 11g FOR ADDB7311 LEARNING UNIT 2 of 7.
© 2009 Punjab University College of Information Technology (PUCIT) September 8, 2009 Slide 1 (SQL) Other Database Objects Asif Sohail University of the.
9 Copyright © Oracle Corporation, All rights reserved. Creating and Managing Tables.
Chapter 5 : Integrity And Security  Domain Constraints  Referential Integrity  Security  Triggers  Authorization  Authorization in SQL  Views 
Session 1 Module 1: Introduction to Data Integrity
Chapter 4 Indexes. Indexes Logically represents subsets of data from one or more tables View Generates numeric valuesSequence Basic unit of storage; composed.
Transactions, Roles & Privileges Oracle and ANSI Standard SQL Lecture 11.
Chapter 12 Additional Database Objects. Chapter Objectives  Define the purpose of a sequence and state how it can be used by an organization  Explain.
Altering Tables and Constraints Database Systems Objectives Add and modify columns. Add, enable, disable, or remove constraints. Drop a table. Remove.
DDL and Views. Database Objects Logically represents subsets of data from one or more tables View Generates numeric valuesSequence Basic unit of storage;
Chapter 13Introduction to Oracle9i: SQL1 Chapter 13 User Creation and Management.
Database Programming Sections 12 – Sequences, Indexes, and Synonymns.
Chapter 3 Table Creation and Management Oracle 10g: SQL.
1 11g NEW FEATURES ByVIJAY. 2 AGENDA  RESULT CACHE  INVISIBLE INDEXES  READ ONLY TABLES  DDL WAIT OPTION  ADDING COLUMN TO A TABLE WITH DEFAULT VALUE.
 CONACT UC:  Magnific training   
Other database objects (Sequence and view). What Is a Sequence? A sequence: Automatically generates sequential numbers Is a sharable object Is typically.
ITEC 313 Database Programming
Oracle Certified 1z0-047 Exam Questions
Creating Other Schema Objects
Other Database Objects
Creating Other Schema Objects
Chapter 5 Sequences.
Managing Objects with Data Dictionary Views
Chapter 4 Indexes.
CH 4 Indexes.
Managing Objects with Data Dictionary Views
A Guide to SQL, Eighth Edition
CH 4 Indexes.
Contents Preface I Introduction Lesson Objectives I-2
IST 318 Database Administration
Other Database Objects
Presentation transcript:

Chapter 12Introduction to Oracle9i: SQL1 Chapter 12 Additional Database Objects

Chapter 12Introduction to Oracle9i: SQL2 Database Objects Anything that has a name and defined structure Includes: –Sequence – generate sequential integers –Index – quickly locate specific records –Synonym – alias for other database objects

Chapter 12Introduction to Oracle9i: SQL3 Sequences Used for internal control purposes by providing sequential integers for auditing Used to generate unique value for primary key column – no correlation with actual row contents

Chapter 12Introduction to Oracle9i: SQL4 CREATE SEQUENCE Command Various intervals allowed – Default: 1 Can specify starting number – Default: 1

Chapter 12Introduction to Oracle9i: SQL5 CREATE SEQUENCE Command Can specify MINVALUE for decreasing sequence, MAXVALUE for increasing Numbers can be reused if CYCLE specified ORDER clause for application cluster environment Use CACHE to pre-generate integers – Default: 20

Chapter 12Introduction to Oracle9i: SQL6 CREATE SEQUENCE Command Example

Chapter 12Introduction to Oracle9i: SQL7 Verifying Sequence Values Query USER_SEQUENCES data dictionary view

Chapter 12Introduction to Oracle9i: SQL8 Using Sequence Values NEXTVAL – generates integer CURRVAL – contains last integer generated by NEXTVAL

Chapter 12Introduction to Oracle9i: SQL9 Altering Sequence Definitions Use ALTER SEQUENCE command START WITH value cannot be altered – drop sequence and re-create Changes cannot make current integers invalid

Chapter 12Introduction to Oracle9i: SQL10 ALTER SEQUENCE Command Example

Chapter 12Introduction to Oracle9i: SQL11 DROP SEQUENCE Command Previous values generated are not affected by removing a sequence from a database

Chapter 12Introduction to Oracle9i: SQL12 Indexes Stores frequently referenced value and row ID (ROWID) Can be based on one column, multiple columns, functions, or expressions

Chapter 12Introduction to Oracle9i: SQL13 Creating an Index Implicitly created by PRIMARY KEY and UNIQUE constraints Explicitly created by CREATE INDEX command

Chapter 12Introduction to Oracle9i: SQL14 CREATE INDEX Command Example

Chapter 12Introduction to Oracle9i: SQL15 Verifying an Index Indexes listed in USER_INDEXES view

Chapter 12Introduction to Oracle9i: SQL16 Removing an Index Use DROP INDEX command

Chapter 12Introduction to Oracle9i: SQL17 Synonyms Serve as permanent aliases for database objects Can be private or public –Private synonyms are only available to user who created them –PUBLIC synonyms are available to all database users

Chapter 12Introduction to Oracle9i: SQL18 CREATE SYNONYM Command Syntax

Chapter 12Introduction to Oracle9i: SQL19 CREATE SYNONYM Command Example

Chapter 12Introduction to Oracle9i: SQL20 Deleting a SYNONYM A private synonym can be deleted by owner A PUBLIC synonym can only be deleted by a user with DBA privileges

Chapter 12Introduction to Oracle9i: SQL21 Data Dictionary Stores information about database objects Owned by user SYS Cannot be directly accessed by users Displays contents through data dictionary views

Chapter 12Introduction to Oracle9i: SQL22 View Prefixes