8 Copyright © 2005, Oracle. All rights reserved. Managing Schema Objects
8-2 Copyright © 2005, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Create and modify database tables View data in the database Create additional database objects Load data into tables
8-3 Copyright © 2005, Oracle. All rights reserved. What Is a Schema? HR schema HR user owns
8-4 Copyright © 2005, Oracle. All rights reserved. Schemas Schemas created as part of the database creation process include: SYS SYSTEM Sample schemas
8-5 Copyright © 2005, Oracle. All rights reserved. Full Notes Page
8-6 Copyright © 2005, Oracle. All rights reserved. Accessing Schema Objects Click a link to access the schema objects.
8-7 Copyright © 2005, Oracle. All rights reserved. Specifying Data Types in Tables Common data types: CHAR : Fixed-length character data with length in bytes DATE : Valid date range from January 1, 4712 B.C., to December 31, 9999 A.D. NUMBER : Number having precision p and scale s VARCHAR2 : Variable-length character string with maximum length in bytes or characters
8-8 Copyright © 2005, Oracle. All rights reserved. Creating and Modifying Tables Specify the table name and schema. Specify the column names, data types, and lengths.
8-9 Copyright © 2005, Oracle. All rights reserved. Full Notes Page
8-10 Copyright © 2005, Oracle. All rights reserved. Understanding Data Integrity
8-11 Copyright © 2005, Oracle. All rights reserved. Full Notes Page
8-12 Copyright © 2005, Oracle. All rights reserved. Defining Constraints
8-13 Copyright © 2005, Oracle. All rights reserved. Viewing the Attributes of a Table
8-14 Copyright © 2005, Oracle. All rights reserved. Viewing the Contents of a Table
8-15 Copyright © 2005, Oracle. All rights reserved. Dropping a Table When you drop a table: The table definition is removed from the data dictionary All rows of the table are removed All indexes defined on the table are removed
8-16 Copyright © 2005, Oracle. All rights reserved. Managing Indexes An index: Provides faster access to the rows in a table Is automatically used for data access Is physically independent of the table Is automatically maintained when the table is updated Index entry points to row in table
8-17 Copyright © 2005, Oracle. All rights reserved. Creating and Dropping Indexes
8-18 Copyright © 2005, Oracle. All rights reserved. Managing Views A view is a customized presentation of data from a table or other view. Views do not contain data.
8-19 Copyright © 2005, Oracle. All rights reserved. Managing Database-Resident Program Units Use Enterprise Manager to manage the following types of database-resident program units: Packages Package bodies Stand-alone subprograms –Procedures –Functions Database triggers
8-20 Copyright © 2005, Oracle. All rights reserved. Using Enterprise Manager to Manage Database-Resident Program Units Click a link to access the program units.
8-21 Copyright © 2005, Oracle. All rights reserved. Managing Access to Schema Objects SELECT FROM table GRANT object privileges INSERT UPDATE DELETE EXECUTE
8-22 Copyright © 2005, Oracle. All rights reserved. Loading Data
8-23 Copyright © 2005, Oracle. All rights reserved. Full Notes Page
8-24 Copyright © 2005, Oracle. All rights reserved. Summary In this lesson, you should have learned how to: Create and modify tables Define constraints View the attributes of a table View the contents of a table Create indexes and views Load data into tables
8-25 Copyright © 2005, Oracle. All rights reserved. Practice 8: Overview This practice covers the following topics: Creating a table Defining constraints Creating an index Granting object privileges to a role Loading data
8-26 Copyright © 2005, Oracle. All rights reserved.