← All schemas
Schema Library

DVD Rental Database ER Diagram

The DVD Rental database is the PostgreSQL tutorial's sample schema: a DVD store where films are stocked as inventory per store, customers rent inventory, staff process rentals, and payments record each charge. Fifteen tables are mapped above, from actor and category through film, inventory, rental, payment, and the staff/store geography chain. One detail worth knowing: the tutorial dump is a simplified variant - the store relationships (customer, inventory, and staff each belong to a store) exist as columns but carry no foreign-key constraints in the file, so they are restored here to match the official ER diagram.

Last updated: 2026-09-27

Source: DVD Rental sample database (postgresqltutorial.com), plain-SQL dump via neondatabase/postgres-sample-dbs · License: MIT

Tables
15
Core flow
Film -> Inventory -> Rental -> Payment
Source
PostgreSQL tutorial
Mini Map
Open in DBdiagramr to edit →

Tables in the DVD Rental schema

ColumnTypeNullableKey
customer
customer_idintegerNoPK
store_idsmallintNo-
first_namecharacter varying(45)No-
last_namecharacter varying(45)No-
emailcharacter varying(50)Yes-
address_idsmallintNo-
activeboolbooleanNo-
create_datedateNo-
last_updatetimestamp without time zoneYes-
activeintegerYes-
actor
actor_idintegerNoPK
first_namecharacter varying(45)No-
last_namecharacter varying(45)No-
last_updatetimestamp without time zoneNo-
category
category_idintegerNoPK
namecharacter varying(25)No-
last_updatetimestamp without time zoneNo-
film
film_idintegerNoPK
titlecharacter varying(255)No-
descriptiontextYes-
release_yearpublic.yearYes-
language_idsmallintNo-
rental_durationsmallintNo-
rental_ratenumeric(4,2)No-
lengthsmallintYes-
replacement_costnumeric(5,2)No-
ratingpublic.mpaa_ratingYes-
last_updatetimestamp without time zoneNo-
special_featurestext[]Yes-
fulltexttsvectorNo-
film_actor
actor_idsmallintNoPK
film_idsmallintNoPK
last_updatetimestamp without time zoneNo-
film_category
film_idsmallintNoPK
category_idsmallintNoPK
last_updatetimestamp without time zoneNo-
address
address_idintegerNoPK
addresscharacter varying(50)No-
address2character varying(50)Yes-
districtcharacter varying(20)No-
city_idsmallintNo-
postal_codecharacter varying(10)Yes-
phonecharacter varying(20)No-
last_updatetimestamp without time zoneNo-
city
city_idintegerNoPK
citycharacter varying(50)No-
country_idsmallintNo-
last_updatetimestamp without time zoneNo-
country
country_idintegerNoPK
countrycharacter varying(50)No-
last_updatetimestamp without time zoneNo-
inventory
inventory_idintegerNoPK
film_idsmallintNo-
store_idsmallintNo-
last_updatetimestamp without time zoneNo-
language
language_idintegerNoPK
namecharacter(20)No-
last_updatetimestamp without time zoneNo-
payment
payment_idintegerNoPK
customer_idsmallintNo-
staff_idsmallintNo-
rental_idintegerNo-
amountnumeric(5,2)No-
payment_datetimestamp without time zoneNo-
rental
rental_idintegerNoPK
rental_datetimestamp without time zoneNo-
inventory_idintegerNo-
customer_idsmallintNo-
return_datetimestamp without time zoneYes-
staff_idsmallintNo-
last_updatetimestamp without time zoneNo-
staff
staff_idintegerNoPK
first_namecharacter varying(45)No-
last_namecharacter varying(45)No-
address_idsmallintNo-
emailcharacter varying(50)Yes-
store_idsmallintNo-
activebooleanNo-
usernamecharacter varying(16)No-
passwordcharacter varying(40)Yes-
last_updatetimestamp without time zoneNo-
picturebyteaYes-
store
store_idintegerNoPK
manager_staff_idsmallintNo-
address_idsmallintNo-
last_updatetimestamp without time zoneNo-

Frequently asked questions

What tables are in the DVD Rental database?

The DVD Rental sample database has 15 tables: actor, film, film_actor, film_category, category, language, inventory, store, staff, customer, address, city, country, rental, and payment.

How do films become rentals in the DVD Rental schema?

A film title is stocked as physical inventory rows per store. A rental links one inventory item to one customer and the staff member who processed it, and each rental can produce a payment row. So the path is film -> inventory -> rental -> payment.

Where can I download the DVD Rental sample database?

From postgresqltutorial.com (as a pg_restore archive) or as plain SQL from the neondatabase/postgres-sample-dbs repository on GitHub, which is the source used for this diagram.

Explore more schemas

Visualize your own database

Paste your PostgreSQL connection string and get an interactive ER diagram of your own schema in under 10 seconds. No signup required.

Try it free →