PostgreSQL Tutorials

PostgreSQL provides a well-structured learning path for relational database management. Our tutorials cover SQL queries, database design, and optimization techniques, suitable for both beginners and intermediate developers. With free labs and practical examples, you'll gain hands-on experience in database operations. Our interactive database playground allows you to practice SQL queries and see instant results.

Store and Query Customer Orders

Store and Query Customer Orders

Build an order table in PostgreSQL, insert customer orders and query the same stored data that an application reads.
PostgreSQLAWS
Send Read Requests to a Read Replica

Send Read Requests to a Read Replica

Create a PostgreSQL read replica, route application queries to it and observe new primary writes arrive while direct replica writes are rejected.
AWSPostgreSQL
Restrict Database Access to the Application

Restrict Database Access to the Application

Limit PostgreSQL network access to the application security group and give the order application a database user with only the permissions it needs.
PostgreSQLAWS
Restore Orders from an RDS Snapshot

Restore Orders from an RDS Snapshot

Save a database snapshot, observe a controlled order deletion and recover the application's data by restoring a new RDS instance.
AWSPostgreSQL
Create a PostgreSQL Database for an Application

Create a PostgreSQL Database for an Application

Create a private RDS PostgreSQL instance, connect with a standard SQL client and point an application at its database endpoint before cleaning up.
AWSPostgreSQL
PostgreSQL Role and Permission Management

PostgreSQL Role and Permission Management

In this lab, you will explore PostgreSQL role and permission management. The primary goal is to learn how to create roles with specific attributes and manage database privileges. You'll grant privileges, switch users, and revoke access.
PostgreSQL
PostgreSQL Relationships and Joins

PostgreSQL Relationships and Joins

In this lab, you will explore PostgreSQL relationships and joins. You'll create tables with foreign key constraints, insert data ensuring referential integrity, query data using INNER JOIN, and compare LEFT, RIGHT, and FULL OUTER JOIN results to understand data relationships.
PostgreSQL
PostgreSQL Stored Function Development

PostgreSQL Stored Function Development

In this lab, you will learn how to develop PostgreSQL stored functions. The lab guides you through the process of defining a basic stored function, adding input parameters, and executing it within a query. You will also learn how to remove an unused function.
PostgreSQL
PostgreSQL Streaming Replication

PostgreSQL Streaming Replication

In this lab, you will learn how to set up PostgreSQL streaming replication. You will configure a primary server to accept replication connections, create a replica server from a base backup, and verify that data changes are automatically copied from the primary to the replica in near real-time.
PostgreSQLLinux
PostgreSQL Table Partitioning

PostgreSQL Table Partitioning

In this lab, you will learn how to implement table partitioning in PostgreSQL. The goal is to divide a large table into smaller, more manageable pieces to improve query performance and simplify data management. You will set up a range-partitioned table, define partitions by date ranges, insert data, and query across partitions.
PostgreSQL
PostgreSQL Transaction Management

PostgreSQL Transaction Management

In this lab, you will explore PostgreSQL transaction management, a crucial aspect of ensuring data integrity. You'll learn to begin and commit transactions, roll back failed transactions, set isolation levels, and simulate locks with concurrent updates. Practice with accounts table and fund transfers.
PostgreSQL
PostgreSQL Trigger Automation

PostgreSQL Trigger Automation

In this lab, you will learn how to automate tasks in PostgreSQL using triggers. Create a trigger function using PL/pgSQL to log salary changes in an `employees` table to a `salary_changes` table. You'll write the function, bind it to a table event, test it, and disable/drop it.
PostgreSQL
PostgreSQL Views Management

PostgreSQL Views Management

In this lab, you will explore PostgreSQL Views Management. The primary goal is to understand and implement different types of views, including simple views and materialized views. You'll learn to define, query, modify, create, populate, and refresh views.
PostgreSQL
Verify PostgreSQL Connection Details

Verify PostgreSQL Connection Details

In this challenge, verify PostgreSQL server operational status after a critical alert. Confirm the server accepts connections and connect to the 'postgres' database using `pg_isready` and `psql` commands as the `postgres` user. Ensure the PostgreSQL service is functioning correctly.
PostgreSQL
Create Your Own Recipe Database

Create Your Own Recipe Database

In this challenge, you'll embark on a culinary journey by creating your own recipe database using PostgreSQL. As a budding food blogger, you'll set up a dedicated database named `recipe_db` to manage your growing collection of recipes.
PostgreSQL
Create Employee Table in PostgreSQL

Create Employee Table in PostgreSQL

In this challenge, you will design and create a `employee_contacts` table in PostgreSQL to store employee contact details, ensuring data integrity through appropriate data types and constraints. You'll be working within a pre-configured environment where an `employees` table already exists.
PostgreSQL
Manage Employee Data in PostgreSQL

Manage Employee Data in PostgreSQL

In this challenge, you'll step into the role of a database administrator and manage employee data within a PostgreSQL database. The task involves using PostgreSQL commands to update employee records in the `employees` table to reflect changes in the organization.
PostgreSQL
Find Marketing Employees in PostgreSQL

Find Marketing Employees in PostgreSQL

In this challenge, you'll assist the HR department by extracting a list of Marketing employees from a PostgreSQL database. You'll need to write a SQL query to select the `id` and `name` of employees in the 'Marketing' department, and save the query results to a file for verification.
PostgreSQL
  • Prev
  • 1
  • 2
  • Next