SQLRef
Tutorials and examples for common SQL commands.
Check out my new SQL Server to PostgreSQL Migration tool, Albatross!
Querying data (DQL)
The Basics
Joins
Aggregations
Date Functions
Utilities
Defining data structures (DDL)
DDL is used to define the structure of data.
Create
CREATE TABLE
CREATE INDEX
CREATE SCHEMA
CREATE TABLE
CREATE DATABASE
CREATE USER
CREATE VIEW
CREATE TABLE AS SELECT
Alter
ADD COLUMN
Change Column Datatype
DROP COLUMN
RENAME COLUMN
RENAME DATABASE
RENAME INDEX
RENAME SCHEMA
RENAME TABLE
RENAME USER
Change User Password
RENAME VIEW
Drop
DML
DML is used to alter data.
Insert
Update
Delete
Sample schema
Most of our examples use the same schema. You can view that schema here