PostgreSQL Tutorial

This PostgreSQL tutorial will teach you about PostgreSQL from beginner to advanced.

Section 1. Getting Started

In this section, you’ll begin working with PostgreSQL by learning how to write SQL statements to interact with the databases.

Section 2. Filtering rows

In this section, you’ll learn how to filter rows from a query for to retrieve, update, and delete data from a table.

  • WHERE – Filter rows from a table using the WHERE clause.
  • BETWEEN – Check if a value is between two values.
  • IN – Determine if a value is in a list of values.
  • Update – Update data in one or more rows in a table.
  • Delete – Delete one or more rows from a table.

Section 3. Working with Tables

In this section, you’ll learn how to design a database for an inventory management system from scratch. You’ll start by analyzing the business requirements, identifying tables and relationships, creating tables with primary keys and foreign keys.

  • Database design – Let’s start design a database for the inventory management system from scratch.
  • Primary key – Show you how to define a primary key for a table.
  • NOT NULL constraint – Introduction to NULL and use the NOT NULL constraint to ensure that a column does not have NULL.
  • DEFAULT constraint – Set default values for table columns.
  • CHECK constraint – Add validation rules to one or more columns to ensure that values meet a condition.
  • UNIQUE constraint – Ensure values in a column or a set of columns unique across rows within the same table.
  • Foreign key – Learn how to create foreign keys for a table.