Book description
This volume will take you from novice to master, covering not only how to use SQL but also the Oracle extensions to SQL. The examples feature the sample schemas available with Oracle Database 10g, and free code will be available for download.
Table of contents
- Cover Page
- Oracle Database 10g SQL
- Copyright Page
- Dedication
- About the Authors
- Contents at a Glance
- Contents
- Acknowledgments
- Introduction
-
1 Introduction
- What Is a Relational Database?
- Introducing the Structured Query Language (SQL)
- Using SQL*Plus
- Performing a SELECT Statement Using SQL*Plus
- The SQL*Plus Worksheet
- Creating the Store Schema
- Adding, Modifying, and Removing Rows
- Modifying an Existing Row in a Table
- Removing a Row from a Table
- The New Oracle 10g BINARY_FLOAT and BINARY_DOUBLE Types
- Quitting SQL*Plus
- Introducing Oracle PL/SQL
- Summary
-
2 Retrieving Information from Database Tables
- Performing Single Table SELECT Statements
- Selecting All Columns from a Table
- Understanding Row Identifiers
- Performing Arithmetic
- Using Column Aliases
- Merging Column Output Using Concatenation
- Understanding Null Values
- Displaying Distinct Rows
- Filtering Rows Using the WHERE Clause
- Sorting Rows Using the ORDER BY Clause
- Performing SELECT Statements that Use Two Tables
- Supplying Table Aliases
- Cartesian Products
- Performing SELECT Statements that Use More than Two Tables
- Understanding Join Conditions and Join Types
-
Performing Joins Using the SQL/92 Syntax
- Performing Inner Joins on Two Tables Using SQL/92
- Simplifying Joins with the USING Keyword
- Performing Inner Joins on More than Two Tables Using SQL/92
- Performing Inner Joins on Multiple Columns Using SQL/92
- Performing Outer Joins Using SQL/92
- Performing Self Joins Using SQL/92
- Performing Cross Joins Using SQL/92
- Summary
- 3 Using Simple Functions
- 4 Storing and Processing Dates and Times
- 5 Using SQL*Plus
- 6 Subqueries
-
7 Advanced Queries
- Using the Set Operators
- Using the TRANSLATE() Function
- Using the DECODE() Function
- Using the CASE Expression
-
Hierarchical Queries
- The Example Data
- Using the CONNECT BY and START WITH Clauses
- Using the LEVEL Pseudo-Column
- Formatting the Results from a Hierarchical Query
- Starting at a Node Other than the Root
- Using a Subquery in a START WITH Clause
- Traversing Upward Through the Tree
- Eliminating Nodes and Branches from a Hierarchical Query
- Including Other Conditions in a Hierarchical Query
- Using the Extended GROUP BY Clauses
- Using the ROLLUP Clause
-
Using the Analytic Functions
- The Example Table
- Using the Ranking Functions
- Using the Inverse Percentile Functions
- Using the Window Functions
- Using the Reporting Functions
- Using the LAG() and LEAD() Functions
- Using the FIRST and LAST Functions
- Using the Linear Regression Functions
- Using the Hypothetical Rank and Distribution Functions
-
Using the MODEL Clause
- An Example of the MODEL Clause
- Using Positional and Symbolic Notation to Access Cells
- Accessing a Range of Cells Using BETWEEN and AND
- Accessing All Cells Using ANY and IS ANY
- Getting the Current Value of a Dimension Using CURRENTV()
- Accessing Cells Using a FOR Loop
- Handling Null and Missing Values
- Updating Existing Cells
- Summary
- 8 Changing Table Contents
-
9 Database Security
- Users
- System Privileges
- Object Privileges
-
Roles
- Creating Roles
- Granting Privileges to Roles
- Granting Roles to a User
- Checking Roles Granted to a User
- Checking System Privileges Granted to a Role
- Checking Object Privileges Granted to a Role
- Making Use of Privileges Granted to a Role
- Default Roles
- Revoking a Role
- Revoking Privileges from a Role
- Dropping a Role
- Summary
- 10 Creating Tables, Sequences, Indexes, and Views
- 11 Introducing PL/SQL Programming
-
12 Database Objects
- Introducing Objects
- Creating Object Types
- Using DESCRIBE to Get Information on Object Types
- Using Object Types to Define Column Objects and Object Tables
- Performing DML on the products Table
- Performing DML on the object_products Table
- Performing DML on the object_customers Table
- Performing DML on the purchases Table
- Using Objects in PL/SQL
- Type Inheritance
- NOT INSTANTIABLE Object Types
- User-Defined Constructors
- Summary
- 13 Collections
-
14 Large Objects
- Introducing Large Objects (LOBs)
- The Example Files
- Understanding the Large Object Types
- Creating Tables Containing Large Objects
- Using Large Objects in SQL
-
Using Large Objects in PL/SQL
- READ()
- WRITE()
- APPEND()
- CLOSE()
- COMPARE()
- COPY()
- CREATETEMPORARY()
- ERASE()
- FILECLOSE()
- FILECLOSEALL()
- FILEEXISTS()
- FILEGETNAME()
- FILEISOPEN()
- FILEOPEN()
- FREETEMPORARY()
- GETCHUNKSIZE()
- GET_STORAGE_LIMIT()
- GETLENGTH()
- INSTR()
- ISOPEN()
- ISTEMPORARY()
- LOADFROMFILE()
- LOADBLOBFROMFILE()
- LOADCLOBFROMFILE()
- OPEN()
- SUBSTR()
- TRIM()
- WRITEAPPEND()
- Understanding the LONG and LONG RAW Types
- Oracle Database 10g Enhancements to Large Objects
- Summary
-
15 Running SQL Using Java
- Getting Started
- Configuring Your Computer
- The Oracle JDBC Drivers
- Importing the JDBC Packages
- Registering the Oracle JDBC Drivers
- Opening a Database Connection
- Creating a JDBC Statement Object
- Retrieving Rows from the Database
- Adding Rows to the Database
- Modifying Rows in the Database
- Deleting Rows from the Database
- Handling Numbers
- Handling Database Null Values
- Controlling Database Transactions
- Performing Data Definition Language Statements
- Handling Exceptions
- Closing Your JDBC Objects
- Example Program: BasicExample1.java
- Prepared SQL Statements
- Example Program: BasicExample2.java
- The Oracle JDBC Extensions
- Summary
-
16 High Performance SQL Tuning
- Introducing SQL Tuning
- Use a WHERE Clause to Filter Rows
- Use Table Joins Rather than Multiple Queries
- Use Fully Qualified Column References When Performing Joins
- Use CASE Expressions Rather than Multiple Queries
- Add Indexes to Tables
- Use WHERE Rather than HAVING
- Use UNION ALL Rather than UNION
- Use EXISTS Rather than IN
- Use EXISTS Rather than DISTINCT
- Use Bind Variables
- Comparing the Cost of Performing Queries
- Passing Hints to the Optimizer
- Additional Tuning Tools
- Summary
- A Oracle Data Types
- Index
Product information
- Title: Oracle Database 10g SQL
- Author(s):
- Release date: March 2004
- Publisher(s): McGraw Hill Computing
- ISBN: 9780071706704
You might also like
book
Oracle Database 10g The Complete Reference
Get a thorough understanding of Oracle Database 10 g from the most comprehensive Oracle database reference …
book
Oracle Database 10g: A Beginner's Guide
Provides beginning DBAs and developers with a solid foundation in the database administration and programming basics …
book
Oracle Database 10g Linux Administration
Install and configure Oracle Database 10g on a Linux enterprise platform. This book explains how to …
book
Oracle Database 10g PL/SQL Programming
Create dynamic client/server applications using PL/SQL and the comprehensive information contained in this authoritative volume. Expert …