Search This Blog

PostgreSQL Tutorial

 

PostgreSQL Tutorial

postgresql


PostgreSQL is the world's most advanced open-source relational database technology.

Our tutorial will start with the basics of PostgreSQL such as how to retrieve and manipulate data. Then we will move to the more advanced topics such as how to create tables and users. We will conclude with a review of the functions that are proprietary to PostgreSQL.

With this tutorial, you should be on your way to becoming proficient in PostgreSQL and its programming language.

Prerequisites

There are no prequisities for this PostgreSQL tutorial. You should be able to easily understand this tutorial and learn the basic concepts of PostgreSQL as you progress to the more advanced topics.

Now, let's get started!

Start Tutorial

Or jump directly to a topic in PostgreSQL:

PostgreSQL Functions

Functions - AlphabeticalPostgreSQL Functions listed alphabetically
Functions - CategoryPostgreSQL Functions listed by category

PostgreSQL Keys, Constraints and Indexes

Primary KeysCreate, alter, or drop primary keys
Unique ConstraintsCreate, add, and drop unique constraints
IndexesCreate, drop and rename indexes (performance tuning)

PostgreSQL Privileges and Passwords

Grant/Revoke PrivilegesGrant or revoke privileges
Change PasswordChange a user's password

PostgreSQL Database Administration

UsersDatabase accounts
VacuumReclaim unused space in database
AutoVacuumDaemon that automatically reclaims unused space in database

PostgreSQL Programming

Literals (Constants)String, number, date, time, boolean literals
Declaring VariablesDeclare variables within stored programs
Comments within SQLHow to create comments within your SQL statement

PostgreSQL Comparison Operators

Comparison OperatorsOperators such as =, <>, !=, >, <, and so on

PostgreSQL Query Types

SELECT StatementRetrieve records from a table
SELECT LIMIT StatementRetrieve records from a table and limit results
INSERT StatementInsert records into a table
UPDATE StatementUpdate records in a table
DELETE StatementDelete records from a table
TRUNCATE TABLE StatementDelete all records from a table (deallocates space)
UNION OperatorCombine 2 result sets (removes duplicates)
UNION ALL OperatorCombine 2 result sets (includes duplicates)
INTERSECT OperatorIntersection of 2 result sets
EXCEPT OperatorResult set of one minus the result set of another
SubqueriesA query within a query

PostgreSQL Joins

JOIN TablesInner and Outer joins

PostgreSQL Aliases

ALIASESCreate a temporary name for a column or table

PostgreSQL Clauses

DISTINCT ClauseRetrieve unique records
FROM ClauseList tables and join information
WHERE ClauseFilter results
ORDER BY ClauseSort query results
GROUP BY ClauseGroup by one or more columns
HAVING ClauseRestrict the groups of returned rows

PostgreSQL SQL Functions

COUNT FunctionReturn the count of an expression
SUM FunctionReturn the sum of an expression
MIN FunctionReturn the min of an expression
MAX FunctionReturn the max of an expression
AVG FunctionReturn the average of an expression

PostgreSQL Conditions

AND Condition2 or more conditions to be met
OR ConditionAny one of the conditions are met
AND and ORCombine AND and OR conditions
LIKE ConditionUse wildcards in a WHERE clause
IN ConditionAlternative to multiple OR conditions
NOT ConditionNegate a condition
IS NULL ConditionTest for a NULL value
IS NOT NULL ConditionTest for a NOT NULL value
BETWEEN ConditionRetrieve within a range (inclusive)
EXISTS ConditionCondition is met if subquery returns at least one row

PostgreSQL Tables

CREATE TABLECreate a table
CREATE TABLE ASCreate a table from another table's definition and data
ALTER TABLEAdd, modify, delete columns in a table; rename a table
DROP TABLEDelete a table
VIEWVirtual tables (views of other tables)

PostgreSQL Data Types

Data TypesData Types in PostgreSQL

No comments:

Post a Comment

PostgreSQL: Indexes

  PostgreSQL:   Indexes This PostgreSQL tutorial explains how to   create, drop, and rename indexes   in PostgreSQL with syntax and examples...