Book description
Write Powerful SQL Statements and PL/SQL Programs
Learn how to access Oracle databases through SQL statements and construct PL/SQL programs. Oracle Database 12c SQL offers complete coverage of the latest database features and techniques. Find out how to write SQL statements to retrieve and modify database information, use SQL*Plus and SQL Developer, work with database objects, write PL/SQL programs, use performance optimization techniques, incorporate XML, and more. This Oracle Press guide contains everything you need to know to master SQL.
- Use SQL statements to access an Oracle database
- Work with SQL*Plus and SQL Developer
- Write PL/SQL programs
- Create tables, sequences, indexes, views, and triggers
- Design advanced queries containing complex calculations
- Create database objects to handle abstract data
- Use date, time stamp, and time interval data types
- Establish user roles and privileges
- Handle multimedia files using large objects
- Tune SQL statements to make them execute faster
- Generate, process, and store XML data
- Master the very latest Oracle Database 12c features
Code examples in the book are available for download.
Table of contents
- Cover
- Title Page
- Copyright Page
- About the Author
- Contents at a Glance
- Contents
- Introduction
- Chapter 1: Introduction
-
Chapter 2: Retrieving Information from Database Tables
- Performing Single Table SELECT Statements
- Retrieving All Columns from a Table
- Limiting Rows to Retrieve Using the WHERE Clause
- Row Identifiers
- Row Numbers
- Performing Arithmetic
- Using Column Aliases
- Combining Column Output Using Concatenation
- Null Values
- Displaying Distinct Rows
- Comparing Values
- Using the SQL Operators
- Using the Logical Operators
- Sorting Rows Using the ORDER BY Clause
- Performing SELECT Statements That Use Two Tables
- Using Table Aliases
- Cartesian Products
- Performing SELECT Statements That Use More than Two Tables
- 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
-
Chapter 3: Using SQL*Plus
- Viewing the Structure of a Table
- Editing SQL Statements
- Saving, Retrieving, and Running Files
- Formatting Columns
- Setting the Page Size
- Setting the Line Size
- Clearing Column Formatting
- Using Variables
- Creating Simple Reports
- Getting Help from SQL*Plus
- Automatically Generating SQL Statements
- Disconnecting from the Database and Exiting SQL*Plus
- Summary
- Chapter 4: Using Simple Functions
- Chapter 5: Storing and Processing Dates and Times
- Chapter 6: Subqueries
-
Chapter 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 Recursive Subquery Factoring to Query Hierarchical Data
- Using the ROLLUP and CUBE Clauses
- Using CROSS APPLY and OUTER APPLY
- Using LATERAL
- Summary
-
Chapter 8: Analyzing Data
-
Using 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
- Using the PIVOT and UNPIVOT Clauses
- Performing Top-N Queries
- Finding Patterns in Data
- Summary
-
Using Analytic Functions
- Chapter 9: Changing Table Contents
-
Chapter 10: Users, Privileges, and Roles
- A Very Short Introduction to Database Storage
- 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
- Enabling and Disabling Roles
- Revoking a Role
- Revoking Privileges from a Role
- Dropping a Role
- Auditing
- Summary
-
Chapter 11: Creating Tables, Sequences, Indexes, and Views
-
Tables
- Creating a Table
- Getting Information on Tables
- Getting Information on Columns in Tables
- Altering a Table
- Renaming a Table
- Adding a Comment to a Table
- Truncating a Table
- Dropping a Table
- Using the BINARY_FLOAT and BINARY_DOUBLE Types
- Using DEFAULT ON NULL Columns
- Using Visible and Invisible Columns in a Table
- Sequences
- Indexes
- Views
- Flashback Data Archives
- Summary
-
Tables
- Chapter 12: Introducing PL/SQL Programming
-
Chapter 13: Database Objects
- Introducing Objects
- Running the Script to Create the Object Schema
- Creating Object Types
- Using DESCRIBE to Get Information on Object Types
- Using Object Types in Database Tables
-
Using Objects in PL/SQL
- The get_products() Function
- The display_product() Procedure
- The insert_product() Procedure
- The update_product_price() Procedure
- The get_product() Function
- The update_product() Procedure
- The get_product_ref() Function
- The delete_product() Procedure
- The product_lifecycle() Procedure
- The product_lifecycle2() Procedure
- Type Inheritance
- Using a Subtype Object in Place of a Supertype Object
- Other Useful Object Functions
- NOT INSTANTIABLE Object Types
- User-Defined Constructors
- Overriding Methods
- Generalized Invocation
- Summary
-
Chapter 14: Collections
- Introducing Collections
- Running the Script to Create the Collection Schema
- Creating Collection Types
- Using a Collection Type to Define a Column in a Table
- Getting Information on Collections
- Populating a Collection with Elements
- Retrieving Elements from Collections
- Using TABLE() to Treat a Collection as a Series of Rows
- Modifying Elements of Collections
- Using a Map Method to Compare the Contents of Nested Tables
- Using CAST() to Convert Collections from One Type to Another
- Using Collections in PL/SQL
- Creating and Using Multilevel Collections
- Oracle Database 10g Enhancements to Collections
- Summary
-
Chapter 15: Large Objects
- Introducing Large Objects (LOBs)
- The Example Files
- Large Object Types
- Creating Tables Containing Large Objects
- Using Large Objects in SQL
-
Using Large Objects in PL/SQL
- APPEND()
- CLOSE()
- COMPARE()
- COPY()
- CREATETEMPORARY()
- ERASE()
- FILECLOSE()
- FILECLOSEALL()
- FILEEXISTS()
- FILEGETNAME()
- FILEISOPEN()
- FILEOPEN()
- FREETEMPORARY()
- GETCHUNKSIZE()
- GETLENGTH()
- GET_STORAGE_LIMIT()
- INSTR()
- ISOPEN()
- ISTEMPORARY()
- LOADFROMFILE()
- LOADBLOBFROMFILE()
- LOADCLOBFROMFILE()
- OPEN()
- READ()
- SUBSTR()
- TRIM()
- WRITE()
- WRITEAPPEND()
- Example PL/SQL Procedures
- LONG and LONG RAW Types
- Oracle Database 10g Enhancements to Large Objects
- Oracle Database 11g Enhancements to Large Objects
- Oracle Database 12c Enhancement to Large Objects
- Summary
-
Chapter 16: 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 GROUPING SETS Rather than CUBE
- Use Bind Variables
- Comparing the Cost of Performing Queries
- Passing Hints to the Optimizer
- Additional Tuning Tools
- Summary
- Chapter 17: XML and the Oracle Database
- Appendix: Oracle Data Types
- Index
Product information
- Title: Oracle Database 12c SQL
- Author(s):
- Release date: June 2013
- Publisher(s): McGraw Hill Computing
- ISBN: 9780071799362
You might also like
book
Oracle Database 12c The Complete Reference
Master the Cutting-Edge Features of Oracle Database 12c Maintain a scalable, highly available enterprise platform and …
video
Oracle SQL
Overview Oracle SQL LiveLessons covers the basics of the Oracle SQL programming language. This course covers …
book
Beginning Oracle SQL: for Oracle Database 12c, Third Edition
Beginning Oracle SQL is your introduction to the interactive query tools and specific dialect of SQL …
book
Oracle Database 12c Release 2 Multitenant
Master the Powerful Multitenant Features of Oracle Database 12c Govern a scalable, extensible, and highly available …