Writing Basic SQL SELECT Statements
Basic SELECT Statement
Selecting Specific Columns
Column Heading Defaults
Using Arithmetic Operators
Using Parentheses
Null Values in Arithmetic Expressions
Using Column Aliases
Using the Concatenation Operator
Using Literal Character Strings
Eliminating Duplicate Rows
Limiting Rows Using a Selection
Using the WHERE Clause
Comparison Conditions
Other Comparison Conditions
Using the IN Condition
Using the NULL Conditions
Using the AND Operator
Using the NOT Operator
ORDER BY Clause
Sorting by Column Alias
SQL Functions
Single-Row Functions
Case Manipulation Functions
Character-Manipulation Functions
Number Functions
Using the TRUNC Function
Working with Dates
Using Arithmetic Operators with Dates
Using Date Functions
Implicit Data Type Conversion
Using the TO_CHAR Function with Dates
Using the TO_CHAR Function with Dates
Using the TO_NUMBER and TO_DATE Functions
Using the NVL Function
Using the NULLIF Function
Conditional Expressions
Using the CASE Expression
Using the DECODE Function
Obtaining Data from Multiple Tables
Generating a Cartesian Product
Joining Tables Using Oracle Syntax
Retrieving Records with Equijoins
Qualifying Ambiguous Column Names
Joining More than Two Tables
Retrieving Records with Non-Equijoins
Outer Joins Syntax
Self Joins
INNER Versus OUTER Joins
RIGHT OUTER JOIN
Types of Group Functions
Using the AVG and SUM Functions
Using the COUNT Function
Group Functions and Null Values
Creating Groups of Data
Using the GROUP BY Clause
Using the GROUP BY Clause on Multiple Columns
Excluding Group Results
Using the HAVING Clause
Using a Subquery to Solve a Problem
Using a Subquery
Types of Subqueries
Executing Single-Row Subqueries
The HAVING Clause with Subqueries
Using the ANY Operator in Multiple-Row Subqueries
Null Values in a Subquery
Data Manipulation Language
The INSERT Statement Syntax
Inserting Rows with Null Values
Inserting Specific Date Values
Copying Rows from Another Table
The UPDATE Statement Syntax
Updating Two Columns with a Subquery
Updating Rows Integrity Constraint Error
The DELETE Statement
Deleting Rows Based on Another Table
Using a Subquery in an INSERT Statement
Overview of the Explict Default Feature
The MERGE Statement
Merging Rows
Advantages of COMMIT and ROLLBACK Statements
Rolling Back Changes to a Marker
State of the Data Before COMMIT or ROLLBACK
Committing Data
Statement-Level Rollback
Database Objects
The CREATE TABLE Statement
The DEFAULT Option
Tables in the Oracle Database
Data Types
INTERVAL YEAR TO MONTH Data Type
Creating a Table by Using a Subquery
Adding a Column
Dropping a Column
Dropping a Table
Truncating a Table
Constraint Guidelines
The NOT NULL Constraint
The PRIMARY KEY Constraint
FOREIGN KEY Constraint Keywords
Adding a Constraint Syntax
Dropping a Constraint
Enabling Constraints
Viewing Constraints
Database Objects
Why use Views?
Creating a View
Querying a View
Creating a Complex View
Using the WITH CHECK OPTION Clause
Removing a View
Database Objects
The CREATE SEQUENCE Statement Syntax
Confirming Sequences
Using a Sequence
Guidelines for Modifying a Sequence
What is an Index?
Creating an Index
When Not to Create an Index
Function-Based Indexes
Synonyms
Privileges
Creating Users
Granting System Privileges
Creating and Granting Privileges to a Role
Object Privileges
Using the WITH GRANT OPTION and PUBLIC Keywords
How to Revoke Object Privileges