PostgreSQL: The definitive guide
Prev
Next
II. Using PostgreSQL
Table of Contents
5.
Understanding SQL
5.1.
Introduction to SQL
5.1.1.
A Brief History of SQL
5.1.2.
SQL and Its Predecessors
5.1.3.
SQL Standards
5.2.
Introduction to Relational Databases
5.2.1.
Understanding Databases
5.2.2.
Understanding Tables
5.3.
SQL Statements
5.3.1.
The Anatomy of a SQL Statement
5.3.2.
Token Formatting Considerations
5.3.3.
Keywords and Identifiers
5.3.4.
Constants
5.3.5.
Special Character Symbols
5.3.6.
Comments
5.3.7.
Putting It All Together
5.4.
Data Types
5.4.1.
NULL Values
5.4.2.
Boolean Values
5.4.3.
Character Types
5.4.4.
Numeric Types
5.4.5.
Date and Time Types
5.4.6.
Geometric types
5.4.7.
Arrays
5.4.8.
Type Coercion
5.5.
Tables in PostgreSQL
5.5.1.
System Columns
5.5.2.
Object Identifiers
5.5.3.
Planning Ahead
6.
Using SQL with PostgreSQL
6.1.
Introduction to psql
6.1.1.
Starting psql
6.1.2.
Introduction to psql Syntax
6.1.3.
Executing Queries
6.2.
Using Tables
6.2.1.
Creating Tables with CREATE TABLE
6.2.2.
Altering Tables with ALTER TABLE
6.2.3.
Restructuring Existing Tables
6.2.4.
Destroying Tables with DROP TABLE
6.3.
Adding Data with INSERT and COPY
6.3.1.
Inserting New Values
6.3.2.
Inserting Values from Other Tables with SELECT
6.3.3.
Copying Values from External Files with COPY
6.4.
Retrieving Rows with SELECT
6.4.1.
A Simple SELECT
6.4.2.
Specifying Target Columns
6.4.3.
Expressions, Constants, and Aliases
6.4.4.
Selecting Sources with the FROM Clause
6.4.5.
Aliasing FROM Sources
6.4.6.
Removing Duplicate Rows with DISTINCT
6.4.7.
Qualifying with the WHERE Clause
6.4.8.
Joining Data Sets with JOIN
6.4.9.
Grouping Rows with GROUP BY
6.4.10.
Sorting Rows with ORDER BY
6.4.11.
Setting Row Range with LIMIT and OFFSET
6.4.12.
Comparing Sets with UNION, INTERSECT & EXCEPT
6.4.13.
Using Case Expressions
6.4.14.
Creating Tables from Other Tables
6.5.
Modifying Rows with UPDATE
6.5.1.
Updating Entire Columns
6.5.2.
Updating Several Columns
6.5.3.
Updating from Several Sources
6.6.
Removing Rows with DELETE
6.7.
Using Sub-Queries
6.8.
Using Views
6.8.1.
Creating a View
6.8.2.
Applying Views
6.8.3.
Destroying a view
6.9.
Further SQL Application
7.
Operators and Functions
7.1.
Operators
7.1.1.
Using Operators
7.1.2.
Character String Operators
7.1.3.
Numeric Operators
7.1.4.
Logical Operators
7.1.5.
Using Operators with NULL
7.1.6.
Operator Precedence
7.2.
Functions
7.2.1.
Using Functions
7.2.2.
Mathematical Functions
7.2.3.
Character String Functions
7.2.4.
Date and Time Functions
7.2.5.
Type Conversion Functions
7.2.6.
Aggregate Functions
8.
PostgreSQL Clients
8.1.
The psql Client: Advanced Topics
8.1.1.
Command Line Options
8.1.2.
Slash Commands
8.1.3.
Using External Files to Enter Queries
8.1.4.
The Readline and History Libraries
8.1.5.
Variable Substitution
8.1.6.
About the psql Prompt
8.2.
PgAccess: A Graphical Client
8.2.1.
Installation and Basic Configuration
8.2.2.
Managing Users
8.2.3.
Managing Groups
8.2.4.
Creating Databases
8.2.5.
Creating Tables
8.2.6.
Using Queries
8.2.7.
Creating Functions
9.
Advanced Features
9.1.
Indices
9.1.1.
Creating an Index
9.1.2.
Destroying an Index
9.2.
Advanced Table Techniques
9.2.1.
Using Constraints
9.2.2.
Inheritance
9.3.
Arrays
9.3.1.
Creating an Array Column
9.3.2.
Inserting Values into Array Columns
9.3.3.
Selecting Values From Array Columns
9.3.4.
Updating Values in Array Columns
9.4.
Automating Common Routines
9.4.1.
Sequences
9.4.2.
Triggers
9.5.
Transactions and Cursors
9.5.1.
Using Transaction Blocks
9.5.2.
Using Cursors
9.6.
Extending PostgreSQL
9.6.1.
Creating New Functions
9.6.2.
Creating New Operators
Prev
Home
Next
Backing Up and Restoring Data
Understanding SQL