20 relationships connect the tables in this schema. Each entry shows the child columns, the parent columns they reference, and the cardinality.
store.manager_staff_id points to staff.staff_id by name, but pagila-schema.sql declares no foreign-key constraint on that column.
One-to-many
customer.address_id → address.address_id
One address can have many customers (customer.address_id -> address.address_id, required).
One-to-many
customer.store_id → store.store_id
One store can have many customers (customer.store_id -> store.store_id, required).
One-to-many
film.language_id → language.language_id
One language can have many films (film.language_id -> language.language_id, required).
One-to-many
film.original_language_id → language.language_id
One language can have many films (film.original_language_id -> language.language_id, optional).
Many-to-many
film_actor (actor_id -> actor.actor_id, film_id -> film.film_id)
Many actors can have many films through film_actor (film_actor.actor_id -> actor.actor_id, film_actor.film_id -> film.film_id).
Many-to-many
film_category (category_id -> category.category_id, film_id -> film.film_id)
Many categories can have many films through film_category (film_category.category_id -> category.category_id, film_category.film_id -> film.film_id).
One-to-one
film_embedding.film_id → film.film_id
Each film embedding has one film (film_embedding.film_id -> film.film_id, required).
One-to-many
address.city_id → city.city_id
One city can have many addresses (address.city_id -> city.city_id, required).
One-to-many
city.country_id → country.country_id
One country can have many cities (city.country_id -> country.country_id, required).
One-to-many
inventory.film_id → film.film_id
One film can have many inventories (inventory.film_id -> film.film_id, required).
One-to-many
inventory.store_id → store.store_id
One store can have many inventories (inventory.store_id -> store.store_id, required).
One-to-many
payment.customer_id → customer.customer_id
One customer can have many payments (payment.customer_id -> customer.customer_id, required).
One-to-many
payment.staff_id → staff.staff_id
One staff can have many payments (payment.staff_id -> staff.staff_id, required).
One-to-many
payment.rental_id → rental.rental_id
One rental can have many payments (payment.rental_id -> rental.rental_id, required).
One-to-many
rental.customer_id → customer.customer_id
One customer can have many rentals (rental.customer_id -> customer.customer_id, required).
One-to-many
rental.inventory_id → inventory.inventory_id
One inventory can have many rentals (rental.inventory_id -> inventory.inventory_id, required).
One-to-many
rental.staff_id → staff.staff_id
One staff can have many rentals (rental.staff_id -> staff.staff_id, required).
One-to-many
staff.address_id → address.address_id
One address can have many staffs (staff.address_id -> address.address_id, required).
One-to-many
staff.store_id → store.store_id
One store can have many staffs (staff.store_id -> store.store_id, required).
One-to-many
store.address_id → address.address_id
One address can have many stores (store.address_id -> address.address_id, required).