Example 2 - "DVD Rentals" application

Schema

This is a DVD Rentals example database schema from PostgreSQL Tutorial.

There are 15 tables in the DVD Rental database:

  • actor – stores actors data including first name and last name.

  • film – stores film 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 store 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 customer data.

  • address – stores address data for staff and customers

  • city – stores city names.

  • country – stores country names.

Here is the ERD of the sample DVD rentals database:

  • This is the schema in the Neurelo Schema Language JSON Specification format

JSON Schema

GET endpoint examples

  • Retrieve all actors

  • Retrieve a specific actor by id

    or

  • Retrieve a specific actor

  • Retrieve 5 customers

  • Retrieve all films and their actors

  • Retrieve stores and their employees

  • Retrieve rentals and films

  • Retrieve films by category

  • Retrieve customers that have rented a movie after 2006-01-01

  • Retrieve customers that have more than 35 rentals

  • Retrieve count of films in english by category

  • Get all films where (special features contains "Commentaries" OR length > 160) AND replacement cost > 29

POST endpoint examples

  • Create a new actor

  • Create multiple rentals

  • Create a film and related data

PATCH endpoint examples

  • Update a film

DELETE endpoint examples

  • Delete an actor

  • Delete films by name

Last updated