Presentation is loading. Please wait.

Presentation is loading. Please wait.

8 Copyright © 2004, Oracle. All rights reserved. Managing Schema Objects.

Similar presentations


Presentation on theme: "8 Copyright © 2004, Oracle. All rights reserved. Managing Schema Objects."— Presentation transcript:

1 8 Copyright © 2004, Oracle. All rights reserved. Managing Schema Objects

2 8-2 Copyright © 2004, Oracle. All rights reserved. Objectives After completing this lesson, you should be able to do the following: Create and modify tables Define constraints View the attributes of a table View the contents of a table Create indexes and views

3 8-3 Copyright © 2004, Oracle. All rights reserved. What Is a Schema? HR schema HR user owns

4 8-4 Copyright © 2004, Oracle. All rights reserved. Schemas Schemas created as part of the database creation process: SYS SYSTEM Sample schemas

5 8-5 Copyright © 2004, Oracle. All rights reserved. Schemas - Full Notes Page

6 8-6 Copyright © 2004, Oracle. All rights reserved. Accessing Schema Objects Click a link to access the schema objects.

7 8-7 Copyright © 2004, Oracle. All rights reserved. Naming Database Objects Names must be from 1 to 30 bytes long with these exceptions: –Names of databases are limited to 8 bytes –Names of database links can be as long as 128 bytes Nonquoted names cannot be Oracle reserved words. Nonquoted names must begin with an alphabetic character from your database character set.

8 8-8 Copyright © 2004, Oracle. All rights reserved. Naming Database Objects Nonquoted names can contain only –Alphanumeric characters from your database character set –The underscore (_) –Dollar sign ($) –Pound sign (#) No two objects can have the same name within the same namespace

9 8-9 Copyright © 2004, Oracle. All rights reserved. Schema Object Namespaces The following have their own namespace: Indexes Constraints Clusters Database triggers Private database links Dimensions The following are in the same namespace: Tables Views Sequences Private synonyms Stand-alone procedures Stand-alone stored functions Packages Materialized views User-defined types

10 8-10 Copyright © 2004, Oracle. All rights reserved. Specifying Data Types in Tables Common data types: CHAR(size) : Fixed-length character data of length size bytes VARCHAR2(size) : Variable-length character string having maximum length size bytes DATE : Valid date range from January 1, 4712 BC to December 31, 9999 AD NUMBER(p,s) : Number having precision p and scale s

11 8-11 Copyright © 2004, Oracle. All rights reserved. Other Data Types FLOAT INTEGER NCHAR NVARCHAR2 LONG LONG RAW RAW ROWID UROWID BLOB CLOB NCLOB BFILE TIMESTAMP

12 8-12 Copyright © 2004, Oracle. All rights reserved. Other Data Types Full Notes Page

13 8-13 Copyright © 2004, Oracle. All rights reserved. Creating and Modifying Tables Specify the table name and schema. Specify the column names, data types, and lengths.

14 8-14 Copyright © 2004, Oracle. All rights reserved. Creating and Modifying Tables Full Notes Page

15 8-15 Copyright © 2004, Oracle. All rights reserved. Understanding Data Integrity

16 8-16 Copyright © 2004, Oracle. All rights reserved. Understanding Data Integrity Full Notes Page

17 8-17 Copyright © 2004, Oracle. All rights reserved. Defining Constraints

18 8-18 Copyright © 2004, Oracle. All rights reserved. Viewing the Attributes of a Table

19 8-19 Copyright © 2004, Oracle. All rights reserved. Viewing the Contents of a Table

20 8-20 Copyright © 2004, Oracle. All rights reserved. Actions with Tables

21 8-21 Copyright © 2004, Oracle. All rights reserved. Actions with Tables Full Notes Page

22 8-22 Copyright © 2004, Oracle. All rights reserved. Creating Indexes

23 8-23 Copyright © 2004, Oracle. All rights reserved. What Is a View? Tailored representation of data in a table or view Views do not contain data

24 8-24 Copyright © 2004, Oracle. All rights reserved. Creating Views

25 8-25 Copyright © 2004, Oracle. All rights reserved. What Is a Sequence?

26 8-26 Copyright © 2004, Oracle. All rights reserved. What Is a Sequence? Full Notes Page

27 8-27 Copyright © 2004, Oracle. All rights reserved. Using a Sequence

28 8-28 Copyright © 2004, 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

29 8-29 Copyright © 2004, Oracle. All rights reserved. Practice 8: Working with Tables This practice covers the following: Creating tables and indexes Modifying tables Dropping a table Creating a view

30 8-30 Copyright © 2004, Oracle. All rights reserved. Practice 8 – Working with Tables Full Notes Page

31 8-31 Copyright © 2004, Oracle. All rights reserved. Practice 8 – Working with Tables Full Notes Page

32 8-32 Copyright © 2004, Oracle. All rights reserved. Practice 8 – Working with Tables Full Notes Page


Download ppt "8 Copyright © 2004, Oracle. All rights reserved. Managing Schema Objects."

Similar presentations


Ads by Google