Documente Academic
Documente Profesional
Documente Cultură
Preface
I Course Introduction
Course Objectives I-2
Course Agenda I-3
Human Resources (HR) Schema I-5
iii
Using Expressions 3-18
Conditional Querying Using the CASE Expression 3-19
Using Conditions 3-21
Understanding Functions 3-22
Two Types of SQL Functions 3-23
Manipulating Data Items Using Single-Row Functions 3-24
Using Numeric Functions 3-26
Using the ROUND and TRUNC Functions 3-27
Practice 3: Overview of Part 1 3-29
Understanding Data Types 3-30
Using Datetime Data Types 3-33
Using INTERVAL Data Types 3-37
Converting Between Data Types 3-40
Converting Data Types Explicitly 3-42
Displaying a Date in a Specific Format 3-43
Date Format Model Elements 3-44
Using the TO_CHAR Function with Dates and Numbers 3-47
Using the TO_NUMBER and TO_DATE Functions 3-50
Summary 3-51
Practice 3: Overview of Part 2 3-52
iv
“Walking” the Tree 4-38
Walking the Tree: From the Bottom Up 4-40
Walking the Tree: From the Top Down 4-41
Ranking Rows with the LEVEL Pseudocolumn 4-42
Formatting Hierarchical Reports Using LEVEL and LPAD 4-44
Pruning Branches 4-46
Summary 4-47
Practice 4: Overview 4-48
v
Understanding Views 6-15
Differentiating Simple Views from Complex Views 6-16
Creating a View 6-17
Creating a Simple View 6-18
Creating a Complex View 6-20
Querying a View 6-22
Modifying a View 6-23
Performing DML Operations on a View 6-24
Using the WITH CHECK OPTION Clause 6-25
Denying DML Operations 6-27
Removing a View 6-28
Understanding Inline Views 6-29
Understanding Materialized Views 6-31
Comparing Materialized Views with Indexes 6-33
Creating a Materialized View 6-34
Understanding Sequences 6-35
Creating a Sequence 6-36
Confirming Sequences 6-38
Using a Sequence 6-39
Using a Sequence: Example 6-41
Caching Sequence Values 6-42
Altering a Sequence 6-44
Modifying Sequences: Guidelines 6-45
Removing a Sequence 6-46
Creating a Synonym for an Object 6-47
Creating and Removing Synonyms 6-48
Summary 6-49
Practice 6: Overview 6-51
vi
8 Oracle Database Extensions to DML and DDL Statements
Objectives 8-2
Using Multitable INSERT Statements 8-3
Using Unconditional INSERT ALL 8-8
Using Conditional FIRST INSERT 8-11
Using Pivoting INSERT 8-13
Merging Rows by Using the MERGE Statement 8-16
Understanding External Tables 8-19
Creating an External Table 8-20
Creating an External Table: Example 8-22
Querying External Tables 8-27
Understanding Database Transactions 8-28
Using the COMMIT and ROLLBACK Statements 8-30
Committing Changes 8-32
Rolling Back Changes 8-35
Understanding Statement-Level Rollbacks 8-36
Summary 8-37
Practice 8: Overview 8-38
vii