PostgreSQL Tutorial

  • Home
  • Administration
  • Views
  • Triggers
  • Stored Procedures
Home / PostgreSQL Tutorial / PostgreSQL Sample Database

PostgreSQL Sample Database

Summary: in this tutorial, we will introduce you to a PostgreSQL sample database that you can use for learning and practicing PostgreSQL.

We will use the DVD rental database for demonstrating the features of PostgreSQL.

The DVD rental database was ported from the sakila sample database for PostgreSQL with some adjustments. The DVD rental database represents business processes of a DVD rental store. The DVD rental database has many objects including:

  • 15 tables
  • 1 trigger
  • 7 views
  • 8 functions
  • 1 domain
  • 13 sequences

DVD Rental ER Model

PostgreSQL Sample DatabasePostgreSQL Sample Database Tables

There are 15 tables in the DVD Rental database:

  • actor – stores actors data including first name and last name.
  • film – stores films data such as title, release year, length, rating, etc.
  • film_actor – stores the relationships between films and actors.
  • category – stores film’s categories data.
  • film_category- stores the relationships between films and categories.
  • store – contains the stores data including manager staff and address.
  • inventory – stores inventory data.
  • rental – stores rental data.
  • payment – stores customer’s payments.
  • staff – stores staff data.
  • customer – stores customers data.
  • address – stores address data for staff and customers
  • city – stores the city names.
  • country – stores the country names.

Download PostgreSQL sample database

You can download the PostgreSQL DVD Rental sample database via the following link:

DVD Rental Sample Database 538.51 KB
Download DVD Rental Sample Database

The database file is in zipformat ( dvdrental.zip) so you need to extract it to  dvdrental.tar before loading the sample database into the PostgreSQL database server.

Download printable ER diagram

Besides the sample database, we also provide you with a printable ER diagram in PDF format.You can download and print the ER diagram for reference while practicing with PostgreSQL.

DVD Rental ER Diagram 1.24 MB
DVD Rental ER Diagram

This tutorial introduced you to a PostgreSQL sample database named DVD rental. We will use this database in our PostgreSQL tutorials so make sure that you have it in your server.

Previous Tutorial: Install PostgreSQL
Next Tutorial: Load PostgreSQL Sample Database

PostgreSQL Quick Start

  • What is PostgreSQL?
  • Install PostgreSQL
  • Connect to Database
  • Download PostgreSQL Sample Database
  • Load Sample Database
  • Explore Server and Database Objects

PostgreSQL Fundamentals

  • PostgreSQL Select
  • PostgreSQL Order By
  • PostgreSQL Select Distinct
  • PostgreSQL Where
  • PostgreSQL LIMIT
  • PostgreSQL IN
  • PostgreSQL Between
  • PostgreSQL Like
  • PostgreSQL Union
  • PostgreSQL Inner Join
  • PostgreSQL Left Join
  • PostgreSQL Group By
  • PostgreSQL Having
  • PostgreSQL Subquery
  • PostgreSQL Insert
  • PostgreSQL Update
  • PostgreSQL Delete
  • PostgreSQL Data Types
  • PostgreSQL Create Table
  • PostgreSQL Alter Table
  • PostgreSQL Drop Table
  • PostgreSQL Truncate Table
  • PostgreSQL CHECK Constraint
  • PostgreSQL Not-Null Constraint
  • PostgreSQL Foreign Key
  • PostgreSQL Primary Key
  • PostgreSQL UNIQUE Constraint

About PostgreSQL Tutorial

PostgreSQLTutorial.com is a website dedicated to developers and database administrators who are working on PostgreSQL database management system.

We constantly publish useful PostgreSQL tutorials to keep you up-to-date with the latest PostgreSQL features and technologies. All PostgreSQL tutorials are simple, easy-to-follow and practical.

Recent PostgreSQL Tutorials

  • How To Call PostgreSQL Stored Function Using JDBC
  • The Beginner's Guide To PostgreSQL JDBC Transaction
  • How To Delete Data From A PostgreSQL Table Using JDBC
  • How To Update Data in PostgreSQL Database Using JDBC
  • The Complete Guide to Insert Data Into a Table Using JDBC
  • The Ultimate Guide to Query Data from The PostgreSQL Using JDBC
  • Connecting To The PostgreSQL Database
  • PostgreSQL JDBC
  • PL/pgSQL Function That Returns A Table
  • Using PostgreSQL CAST To Convert From One Data Type Into Another

More Tutorials

  • PostgreSQL Functions
  • PostgreSQL JDBC

Site Info

  • Home
  • About Us
  • Contact Us
  • PostgreSQL Resources
  • Privacy Policy

Copyright © 2016 by PostgreSQL Tutorial Website. All Rights Reserved.