You are previewing Oracle SQL, A Beginner's Tutorial, Second Edition.
O'Reilly logo
Oracle SQL, A Beginner's Tutorial, Second Edition

Book Description

This introduction to SQL for the Oracle database begins by discussing exactly how data is stored and maintained in a relational database, familiarizing readers with SQL INSERT, UPDATE, and DELETE statements. The guide then discusses how to construct basic queries, choose an appropriate output, and how to create and use groups. Readers will also learn how to use joins to query data from multiple tables, how to create predefined views that can be stored in a database, and how to utilize the metadata of a database. Appendices round out the book, covering the various indexing techniques available in the Oracle database and discussing how to install Oracle Database Express Edition and list the Oracle built-in data types.

Table of Contents

  1. Introduction
    1. SQL Overview
    2. About This Book
    3. Code Conventions
    4. Code Download
  2. Chapter 1: Storing and Maintaining Data
    1. Selecting A Database to Use
    2. Creating a Table
    3. Adding Data
    4. Updating Data
    5. Deleting Data
    6. The MERGE statement
    7. Altering A Table
    8. Deleting A Table
    9. Summary
  3. Chapter 2: Basic Queries
    1. The SELECT statement
    2. Querying All Data
    3. Selecting Specific Columns
    4. Selecting Rows with WHERE
    5. Compound Conditions
    6. Operator Precedence
    7. The NOT logical operator
    8. The BETWEEN Operator
    9. The IN Operator
    10. The LIKE Operator
    11. Escaping the Wildcard Character
    12. Combining the NOT operator
    13. Handling NULL
    14. Summary
  4. Chapter 3: Query Output
    1. Column Aliases
    2. Expressions
    3. Limiting the Number of Rows
    4. The DISTINCT Keyword
    5. Aggregate Functions
    6. Ordering Output Rows
    7. Storing Query Output
    8. Summary
  5. Chapter 4: Grouping
    1. The GROUP BY Clause
    2. The HAVING Keyword
    3. Summary
  6. Chapter 5: Joins
    1. Primary Keys and Foreign Keys
    2. Querying Multiple Tables
    3. Using Table Aliases
    4. Joining More Than Two Tables
    5. Outer Joins
    6. Self-Joins
    7. Multiple Uses of A Table
    8. Natural Joins
    9. Summary
  7. Chapter 6: Subqueries
    1. Single-Row Subqueries
    2. Multiple-Row Subqueries
    3. Multiply Nested Subqueries
    4. Correlated Subqueries
    5. Factoring
    6. Summary
  8. Chapter 7: Compound Queries
    1. UNION ALL
    2. UNION
    3. INTERSECT
    4. MINUS
    5. Summary
  9. Chapter 8: Views
    1. Creating and Using Views
    2. Nested Views
    3. Managing Views
    4. Summary
  10. Chapter 9: Built-in Functions
    1. Numeric Functions
    2. Character Functions
    3. Datetime Functions
    4. NULL-related functions
    5. Summary
  11. Chapter 10: Regular Expressions
    1. Searching without Regular Expressions
    2. Patterns
    3. Using Metacharacters
    4. Summary
  12. Chapter 11: PL/SQL
    1. Row-by-Row Processing
    2. If-Then-Else Decision Logic
    3. Exception Handling
    4. User-defined Functions
    5. Stored Procedures
    6. Triggers
    7. Transactions
    8. Summary
  13. Chapter 12: Granting Permissions
    1. Using the GRANT Statement
    2. Granting Permissions to Access A Table
    3. Granting Permissions to Access A View
    4. Granting to Public
    5. Granting to A Role
    6. Granting to A PL/SQL Program
    7. Summary
  14. Chapter 13: The Data Dictionary
    1. The Dictionary View
    2. The user_catalog View
    3. The user_tab_cols View
    4. The user_constraints View
    5. The user_procedures View
    6. The user_source View
    7. Summary
  15. Appendix A: Installing Oracle Database XE
    1. Downloading Oracle Database XE
    2. Installing Oracle Database XE
    3. Creating a User with SQL*Plus
  16. Appendix B: Oracle Built-in Data Types
  17. Appendix C: Indexes
    1. Creating an Index
    2. Multi-Column Indexes
    3. Bitmap Indexes
    4. Bitmap Join Indexes
    5. Function-based Indexes
    6. Deleting An Index
  18. Appendix D: Oracle SQL Developer
    1. Downloading and Installing SQL Developer
    2. Creating A Connection
    3. Creating A Database Account
    4. Using SQL Developer