@sakila/pg

sq inspect @ 2026-05-23T04:03:38Z

PropertyValue
Namesakila
FQ namesakila.public
Driverpostgres
DB productPostgreSQL 12.16 on aarch64-unknown-linux-musl, compiled by gcc (Alpine 12.2.1_git20220924-r10) 12.2.1 20220924, 64-bit
DB version12.16
Schemapublic
Catalogsakila
Size16.6MB
Tables21
Views7
Locationpostgres://sakila:xxxxx@localhost/sakila

Entity Relationship Diagram

erDiagram
    actor {
        int actor_id PK
        text first_name
        text last_name
        datetime last_update
    }
    address {
        int address_id PK
        text address
        text address2
        text district
        int city_id FK
        text postal_code
        text phone
        datetime last_update
    }
    category {
        int category_id PK
        text name
        datetime last_update
    }
    city {
        int city_id PK
        text city
        int country_id FK
        datetime last_update
    }
    country {
        int country_id PK
        text country
        datetime last_update
    }
    customer {
        int customer_id PK
        int store_id FK
        text first_name
        text last_name
        text email
        int address_id FK
        bool activebool
        date create_date
        datetime last_update
        int active
    }
    film {
        int film_id PK
        text title
        text description
        int release_year
        int language_id FK
        int original_language_id FK
        int rental_duration
        decimal rental_rate
        int length
        decimal replacement_cost
        unknown rating
        datetime last_update
        unknown special_features
        text fulltext
    }
    film_actor {
        int actor_id PK,FK
        int film_id PK,FK
        datetime last_update
    }
    film_category {
        int film_id PK,FK
        int category_id PK,FK
        datetime last_update
    }
    inventory {
        int inventory_id PK
        int film_id FK
        int store_id FK
        datetime last_update
    }
    language {
        int language_id PK
        text name
        datetime last_update
    }
    payment {
        int payment_id PK
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    payment_p2007_01 {
        int payment_id
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    payment_p2007_02 {
        int payment_id
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    payment_p2007_03 {
        int payment_id
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    payment_p2007_04 {
        int payment_id
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    payment_p2007_05 {
        int payment_id
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    payment_p2007_06 {
        int payment_id
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    rental {
        int rental_id PK
        datetime rental_date
        int inventory_id FK
        int customer_id FK
        datetime return_date
        int staff_id FK
        datetime last_update
    }
    staff {
        int staff_id PK
        text first_name
        text last_name
        int address_id FK
        text email
        int store_id FK
        bool active
        text username
        text password
        datetime last_update
        bytes picture
    }
    store {
        int store_id PK
        int manager_staff_id FK
        int address_id FK
        datetime last_update
    }
    actor_info {
        int actor_id
        text first_name
        text last_name
        text film_info
    }
    customer_list {
        int id
        text name
        text address
        text zip_code
        text phone
        text city
        text country
        text notes
        int sid
    }
    film_list {
        int fid
        text title
        text description
        text category
        decimal price
        int length
        unknown rating
        text actors
    }
    nicer_but_slower_film_list {
        int fid
        text title
        text description
        text category
        decimal price
        int length
        unknown rating
        text actors
    }
    sales_by_film_category {
        text category
        decimal total_sales
    }
    sales_by_store {
        text store
        text manager
        decimal total_sales
    }
    staff_list {
        int id
        text name
        text address
        text zip_code
        text phone
        text city
        text country
        int sid
    }
    city ||--o{ address : "address_city_id_fkey"
    country ||--o{ city : "city_country_id_fkey"
    address ||--o{ customer : "customer_address_id_fkey"
    store ||--o{ customer : "customer_store_id_fkey"
    language |o--o{ film : "film_original_language_id_fkey"
    language ||--o{ film : "film_language_id_fkey"
    actor ||--o{ film_actor : "film_actor_actor_id_fkey"
    film ||--o{ film_actor : "film_actor_film_id_fkey"
    category ||--o{ film_category : "film_category_category_id_fkey"
    film ||--o{ film_category : "film_category_film_id_fkey"
    film ||--o{ inventory : "inventory_film_id_fkey"
    store ||--o{ inventory : "inventory_store_id_fkey"
    customer ||--o{ payment : "payment_customer_id_fkey"
    rental ||--o{ payment : "payment_rental_id_fkey"
    staff ||--o{ payment : "payment_staff_id_fkey"
    customer ||--o{ payment_p2007_01 : "payment_p2007_01_customer_id_fkey"
    rental ||--o{ payment_p2007_01 : "payment_p2007_01_rental_id_fkey"
    staff ||--o{ payment_p2007_01 : "payment_p2007_01_staff_id_fkey"
    customer ||--o{ payment_p2007_02 : "payment_p2007_02_customer_id_fkey"
    rental ||--o{ payment_p2007_02 : "payment_p2007_02_rental_id_fkey"
    staff ||--o{ payment_p2007_02 : "payment_p2007_02_staff_id_fkey"
    customer ||--o{ payment_p2007_03 : "payment_p2007_03_customer_id_fkey"
    rental ||--o{ payment_p2007_03 : "payment_p2007_03_rental_id_fkey"
    staff ||--o{ payment_p2007_03 : "payment_p2007_03_staff_id_fkey"
    customer ||--o{ payment_p2007_04 : "payment_p2007_04_customer_id_fkey"
    rental ||--o{ payment_p2007_04 : "payment_p2007_04_rental_id_fkey"
    staff ||--o{ payment_p2007_04 : "payment_p2007_04_staff_id_fkey"
    customer ||--o{ payment_p2007_05 : "payment_p2007_05_customer_id_fkey"
    rental ||--o{ payment_p2007_05 : "payment_p2007_05_rental_id_fkey"
    staff ||--o{ payment_p2007_05 : "payment_p2007_05_staff_id_fkey"
    customer ||--o{ payment_p2007_06 : "payment_p2007_06_customer_id_fkey"
    rental ||--o{ payment_p2007_06 : "payment_p2007_06_rental_id_fkey"
    staff ||--o{ payment_p2007_06 : "payment_p2007_06_staff_id_fkey"
    customer ||--o{ rental : "rental_customer_id_fkey"
    inventory ||--o{ rental : "rental_inventory_id_fkey"
    staff ||--o{ rental : "rental_staff_id_fkey"
    address ||--o{ staff : "staff_address_id_fkey"
    store ||--o{ staff : "staff_store_id_fkey"
    address ||--o{ store : "store_address_id_fkey"
    staff ||--o{ store : "store_manager_staff_id_fkey"

Tables & views

actor

table · 200 rows · 72.0KB

Entity Relationship Diagram

erDiagram
    actor {
        int actor_id PK
        text first_name
        text last_name
        datetime last_update
    }
    actor ||--o{ film_actor : "film_actor_actor_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
actor_idintegernextval('actor_actor_id_seq'::regclass)
first_namecharacter varying
last_namecharacter varying
last_updatetimestamp without time zonenow()
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
actor_id film_actor.actor_idfilm_actor_actor_id_fkeycascaderestrict
Indexes
IndexColumnsUniquePrimaryType
actor_pkeyactor_idbtree
idx_actor_last_namelast_namebtree

address

table · 603 rows · 144.0KB

Entity Relationship Diagram

erDiagram
    address {
        int address_id PK
        text address
        text address2
        text district
        int city_id FK
        text postal_code
        text phone
        datetime last_update
    }
    city ||--o{ address : "address_city_id_fkey"
    address ||--o{ customer : "customer_address_id_fkey"
    address ||--o{ staff : "staff_address_id_fkey"
    address ||--o{ store : "store_address_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
address_idintegernextval('address_address_id_seq'::regclass)
addresscharacter varying
address2character varying
districtcharacter varying
city_idsmallint
postal_codecharacter varying
phonecharacter varying
last_updatetimestamp without time zonenow()
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
city_id city.city_idaddress_city_id_fkeycascaderestrict
address_id customer.address_idcustomer_address_id_fkeycascaderestrict
address_id staff.address_idstaff_address_id_fkeycascaderestrict
address_id store.address_idstore_address_id_fkeycascaderestrict
Indexes
IndexColumnsUniquePrimaryType
address_pkeyaddress_idbtree
idx_fk_city_idcity_idbtree

category

table · 16 rows · 24.0KB

Entity Relationship Diagram

erDiagram
    category {
        int category_id PK
        text name
        datetime last_update
    }
    category ||--o{ film_category : "film_category_category_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
category_idintegernextval('category_category_id_seq'::regclass)
namecharacter varying
last_updatetimestamp without time zonenow()
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
category_id film_category.category_idfilm_category_category_id_fkeycascaderestrict
Indexes
IndexColumnsUniquePrimaryType
category_pkeycategory_idbtree

city

table · 600 rows · 136.0KB

Entity Relationship Diagram

erDiagram
    city {
        int city_id PK
        text city
        int country_id FK
        datetime last_update
    }
    city ||--o{ address : "address_city_id_fkey"
    country ||--o{ city : "city_country_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
city_idintegernextval('city_city_id_seq'::regclass)
citycharacter varying
country_idsmallint
last_updatetimestamp without time zonenow()
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
country_id country.country_idcity_country_id_fkeycascaderestrict
city_id address.city_idaddress_city_id_fkeycascaderestrict
Indexes
IndexColumnsUniquePrimaryType
city_pkeycity_idbtree
idx_fk_country_idcountry_idbtree

country

table · 109 rows · 24.0KB

Entity Relationship Diagram

erDiagram
    country {
        int country_id PK
        text country
        datetime last_update
    }
    country ||--o{ city : "city_country_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
country_idintegernextval('country_country_id_seq'::regclass)
countrycharacter varying
last_updatetimestamp without time zonenow()
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
country_id city.country_idcity_country_id_fkeycascaderestrict
Indexes
IndexColumnsUniquePrimaryType
country_pkeycountry_idbtree

customer

table · 599 rows · 232.0KB

Entity Relationship Diagram

erDiagram
    customer {
        int customer_id PK
        int store_id FK
        text first_name
        text last_name
        text email
        int address_id FK
        bool activebool
        date create_date
        datetime last_update
        int active
    }
    address ||--o{ customer : "customer_address_id_fkey"
    store ||--o{ customer : "customer_store_id_fkey"
    customer ||--o{ payment : "payment_customer_id_fkey"
    customer ||--o{ payment_p2007_01 : "payment_p2007_01_customer_id_fkey"
    customer ||--o{ payment_p2007_02 : "payment_p2007_02_customer_id_fkey"
    customer ||--o{ payment_p2007_03 : "payment_p2007_03_customer_id_fkey"
    customer ||--o{ payment_p2007_04 : "payment_p2007_04_customer_id_fkey"
    customer ||--o{ payment_p2007_05 : "payment_p2007_05_customer_id_fkey"
    customer ||--o{ payment_p2007_06 : "payment_p2007_06_customer_id_fkey"
    customer ||--o{ rental : "rental_customer_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
customer_idintegernextval('customer_customer_id_seq'::regclass)
store_idsmallint
first_namecharacter varying
last_namecharacter varying
emailcharacter varying
address_idsmallint
activeboolbooleantrue
create_datedate('now'::text)::date
last_updatetimestamp without time zonenow()
activeinteger
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
address_id address.address_idcustomer_address_id_fkeycascaderestrict
store_id store.store_idcustomer_store_id_fkeycascaderestrict
customer_id payment.customer_idpayment_customer_id_fkeycascaderestrict
customer_id payment_p2007_01.customer_idpayment_p2007_01_customer_id_fkey
customer_id payment_p2007_02.customer_idpayment_p2007_02_customer_id_fkey
customer_id payment_p2007_03.customer_idpayment_p2007_03_customer_id_fkey
customer_id payment_p2007_04.customer_idpayment_p2007_04_customer_id_fkey
customer_id payment_p2007_05.customer_idpayment_p2007_05_customer_id_fkey
customer_id payment_p2007_06.customer_idpayment_p2007_06_customer_id_fkey
customer_id rental.customer_idrental_customer_id_fkeycascaderestrict
Indexes
IndexColumnsUniquePrimaryType
customer_pkeycustomer_idbtree
idx_fk_address_idaddress_idbtree
idx_fk_store_idstore_idbtree
idx_last_namelast_namebtree

film

table · 1000 rows · 728.0KB

Entity Relationship Diagram

erDiagram
    film {
        int film_id PK
        text title
        text description
        int release_year
        int language_id FK
        int original_language_id FK
        int rental_duration
        decimal rental_rate
        int length
        decimal replacement_cost
        unknown rating
        datetime last_update
        unknown special_features
        text fulltext
    }
    language |o--o{ film : "film_original_language_id_fkey"
    language ||--o{ film : "film_language_id_fkey"
    film ||--o{ film_actor : "film_actor_film_id_fkey"
    film ||--o{ film_category : "film_category_film_id_fkey"
    film ||--o{ inventory : "inventory_film_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
film_idintegernextval('film_film_id_seq'::regclass)
titlecharacter varying
descriptiontext
release_yearinteger
language_idsmallint
original_language_idsmallint
rental_durationsmallint3
rental_ratenumeric4.99
lengthsmallint
replacement_costnumeric19.99
ratingUSER-DEFINED'G'::mpaa_rating
last_updatetimestamp without time zonenow()
special_featuresARRAY
fulltexttsvector
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
language_id language.language_idfilm_language_id_fkeycascaderestrict
original_language_id language.language_idfilm_original_language_id_fkeycascaderestrict
film_id film_actor.film_idfilm_actor_film_id_fkeycascaderestrict
film_id film_category.film_idfilm_category_film_id_fkeycascaderestrict
film_id inventory.film_idinventory_film_id_fkeycascaderestrict
Indexes
IndexColumnsUniquePrimaryType
film_fulltext_idxfulltextgist
film_pkeyfilm_idbtree
idx_fk_language_idlanguage_idbtree
idx_fk_original_language_idoriginal_language_idbtree
idx_titletitlebtree

film_actor

table · 5462 rows · 568.0KB

Entity Relationship Diagram

erDiagram
    film_actor {
        int actor_id PK,FK
        int film_id PK,FK
        datetime last_update
    }
    actor ||--o{ film_actor : "film_actor_actor_id_fkey"
    film ||--o{ film_actor : "film_actor_film_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
actor_idsmallint
film_idsmallint
last_updatetimestamp without time zonenow()
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
actor_id actor.actor_idfilm_actor_actor_id_fkeycascaderestrict
film_id film.film_idfilm_actor_film_id_fkeycascaderestrict
Indexes
IndexColumnsUniquePrimaryType
film_actor_pkeyactor_id, film_idbtree
idx_fk_film_idfilm_idbtree

film_category

table · 1000 rows · 112.0KB

Entity Relationship Diagram

erDiagram
    film_category {
        int film_id PK,FK
        int category_id PK,FK
        datetime last_update
    }
    category ||--o{ film_category : "film_category_category_id_fkey"
    film ||--o{ film_category : "film_category_film_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
film_idsmallint
category_idsmallint
last_updatetimestamp without time zonenow()
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
category_id category.category_idfilm_category_category_id_fkeycascaderestrict
film_id film.film_idfilm_category_film_id_fkeycascaderestrict
Indexes
IndexColumnsUniquePrimaryType
film_category_pkeyfilm_id, category_idbtree

inventory

table · 4581 rows · 488.0KB

Entity Relationship Diagram

erDiagram
    inventory {
        int inventory_id PK
        int film_id FK
        int store_id FK
        datetime last_update
    }
    film ||--o{ inventory : "inventory_film_id_fkey"
    store ||--o{ inventory : "inventory_store_id_fkey"
    inventory ||--o{ rental : "rental_inventory_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
inventory_idintegernextval('inventory_inventory_id_seq'::regclass)
film_idsmallint
store_idsmallint
last_updatetimestamp without time zonenow()
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
film_id film.film_idinventory_film_id_fkeycascaderestrict
store_id store.store_idinventory_store_id_fkeycascaderestrict
inventory_id rental.inventory_idrental_inventory_id_fkeycascaderestrict
Indexes
IndexColumnsUniquePrimaryType
idx_store_id_film_idstore_id, film_idbtree
inventory_pkeyinventory_idbtree

language

table · 6 rows · 24.0KB

Entity Relationship Diagram

erDiagram
    language {
        int language_id PK
        text name
        datetime last_update
    }
    language |o--o{ film : "film_original_language_id_fkey"
    language ||--o{ film : "film_language_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
language_idintegernextval('language_language_id_seq'::regclass)
namecharacter
last_updatetimestamp without time zonenow()
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
language_id film.language_idfilm_language_id_fkeycascaderestrict
language_id film.original_language_idfilm_original_language_id_fkeycascaderestrict
Indexes
IndexColumnsUniquePrimaryType
language_pkeylanguage_idbtree

payment

table · 16049 rows · 2.0MB

Entity Relationship Diagram

erDiagram
    payment {
        int payment_id PK
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    customer ||--o{ payment : "payment_customer_id_fkey"
    rental ||--o{ payment : "payment_rental_id_fkey"
    staff ||--o{ payment : "payment_staff_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
payment_idintegernextval('payment_payment_id_seq'::regclass)
customer_idsmallint
staff_idsmallint
rental_idinteger
amountnumeric
payment_datetimestamp without time zone
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
customer_id customer.customer_idpayment_customer_id_fkeycascaderestrict
rental_id rental.rental_idpayment_rental_id_fkeycascadeset null
staff_id staff.staff_idpayment_staff_id_fkeycascaderestrict
Indexes
IndexColumnsUniquePrimaryType
idx_fk_customer_idcustomer_idbtree
idx_fk_staff_idstaff_idbtree
payment_pkeypayment_idbtree

payment_p2007_01

table · 0 rows · 16.0KB

Entity Relationship Diagram

erDiagram
    payment_p2007_01 {
        int payment_id
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    customer ||--o{ payment_p2007_01 : "payment_p2007_01_customer_id_fkey"
    rental ||--o{ payment_p2007_01 : "payment_p2007_01_rental_id_fkey"
    staff ||--o{ payment_p2007_01 : "payment_p2007_01_staff_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
payment_idintegernextval('payment_payment_id_seq'::regclass)
customer_idsmallint
staff_idsmallint
rental_idinteger
amountnumeric
payment_datetimestamp without time zone
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
customer_id customer.customer_idpayment_p2007_01_customer_id_fkey
rental_id rental.rental_idpayment_p2007_01_rental_id_fkey
staff_id staff.staff_idpayment_p2007_01_staff_id_fkey
Indexes
IndexColumnsUniquePrimaryType
idx_fk_payment_p2007_01_customer_idcustomer_idbtree
idx_fk_payment_p2007_01_staff_idstaff_idbtree

payment_p2007_02

table · 0 rows · 16.0KB

Entity Relationship Diagram

erDiagram
    payment_p2007_02 {
        int payment_id
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    customer ||--o{ payment_p2007_02 : "payment_p2007_02_customer_id_fkey"
    rental ||--o{ payment_p2007_02 : "payment_p2007_02_rental_id_fkey"
    staff ||--o{ payment_p2007_02 : "payment_p2007_02_staff_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
payment_idintegernextval('payment_payment_id_seq'::regclass)
customer_idsmallint
staff_idsmallint
rental_idinteger
amountnumeric
payment_datetimestamp without time zone
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
customer_id customer.customer_idpayment_p2007_02_customer_id_fkey
rental_id rental.rental_idpayment_p2007_02_rental_id_fkey
staff_id staff.staff_idpayment_p2007_02_staff_id_fkey
Indexes
IndexColumnsUniquePrimaryType
idx_fk_payment_p2007_02_customer_idcustomer_idbtree
idx_fk_payment_p2007_02_staff_idstaff_idbtree

payment_p2007_03

table · 0 rows · 16.0KB

Entity Relationship Diagram

erDiagram
    payment_p2007_03 {
        int payment_id
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    customer ||--o{ payment_p2007_03 : "payment_p2007_03_customer_id_fkey"
    rental ||--o{ payment_p2007_03 : "payment_p2007_03_rental_id_fkey"
    staff ||--o{ payment_p2007_03 : "payment_p2007_03_staff_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
payment_idintegernextval('payment_payment_id_seq'::regclass)
customer_idsmallint
staff_idsmallint
rental_idinteger
amountnumeric
payment_datetimestamp without time zone
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
customer_id customer.customer_idpayment_p2007_03_customer_id_fkey
rental_id rental.rental_idpayment_p2007_03_rental_id_fkey
staff_id staff.staff_idpayment_p2007_03_staff_id_fkey
Indexes
IndexColumnsUniquePrimaryType
idx_fk_payment_p2007_03_customer_idcustomer_idbtree
idx_fk_payment_p2007_03_staff_idstaff_idbtree

payment_p2007_04

table · 0 rows · 16.0KB

Entity Relationship Diagram

erDiagram
    payment_p2007_04 {
        int payment_id
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    customer ||--o{ payment_p2007_04 : "payment_p2007_04_customer_id_fkey"
    rental ||--o{ payment_p2007_04 : "payment_p2007_04_rental_id_fkey"
    staff ||--o{ payment_p2007_04 : "payment_p2007_04_staff_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
payment_idintegernextval('payment_payment_id_seq'::regclass)
customer_idsmallint
staff_idsmallint
rental_idinteger
amountnumeric
payment_datetimestamp without time zone
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
customer_id customer.customer_idpayment_p2007_04_customer_id_fkey
rental_id rental.rental_idpayment_p2007_04_rental_id_fkey
staff_id staff.staff_idpayment_p2007_04_staff_id_fkey
Indexes
IndexColumnsUniquePrimaryType
idx_fk_payment_p2007_04_customer_idcustomer_idbtree
idx_fk_payment_p2007_04_staff_idstaff_idbtree

payment_p2007_05

table · 0 rows · 16.0KB

Entity Relationship Diagram

erDiagram
    payment_p2007_05 {
        int payment_id
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    customer ||--o{ payment_p2007_05 : "payment_p2007_05_customer_id_fkey"
    rental ||--o{ payment_p2007_05 : "payment_p2007_05_rental_id_fkey"
    staff ||--o{ payment_p2007_05 : "payment_p2007_05_staff_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
payment_idintegernextval('payment_payment_id_seq'::regclass)
customer_idsmallint
staff_idsmallint
rental_idinteger
amountnumeric
payment_datetimestamp without time zone
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
customer_id customer.customer_idpayment_p2007_05_customer_id_fkey
rental_id rental.rental_idpayment_p2007_05_rental_id_fkey
staff_id staff.staff_idpayment_p2007_05_staff_id_fkey
Indexes
IndexColumnsUniquePrimaryType
idx_fk_payment_p2007_05_customer_idcustomer_idbtree
idx_fk_payment_p2007_05_staff_idstaff_idbtree

payment_p2007_06

table · 0 rows · 16.0KB

Entity Relationship Diagram

erDiagram
    payment_p2007_06 {
        int payment_id
        int customer_id FK
        int staff_id FK
        int rental_id FK
        decimal amount
        datetime payment_date
    }
    customer ||--o{ payment_p2007_06 : "payment_p2007_06_customer_id_fkey"
    rental ||--o{ payment_p2007_06 : "payment_p2007_06_rental_id_fkey"
    staff ||--o{ payment_p2007_06 : "payment_p2007_06_staff_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
payment_idintegernextval('payment_payment_id_seq'::regclass)
customer_idsmallint
staff_idsmallint
rental_idinteger
amountnumeric
payment_datetimestamp without time zone
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
customer_id customer.customer_idpayment_p2007_06_customer_id_fkey
rental_id rental.rental_idpayment_p2007_06_rental_id_fkey
staff_id staff.staff_idpayment_p2007_06_staff_id_fkey
Indexes
IndexColumnsUniquePrimaryType
idx_fk_payment_p2007_06_customer_idcustomer_idbtree
idx_fk_payment_p2007_06_staff_idstaff_idbtree

rental

table · 16044 rows · 2.7MB

Entity Relationship Diagram

erDiagram
    rental {
        int rental_id PK
        datetime rental_date
        int inventory_id FK
        int customer_id FK
        datetime return_date
        int staff_id FK
        datetime last_update
    }
    rental ||--o{ payment : "payment_rental_id_fkey"
    rental ||--o{ payment_p2007_01 : "payment_p2007_01_rental_id_fkey"
    rental ||--o{ payment_p2007_02 : "payment_p2007_02_rental_id_fkey"
    rental ||--o{ payment_p2007_03 : "payment_p2007_03_rental_id_fkey"
    rental ||--o{ payment_p2007_04 : "payment_p2007_04_rental_id_fkey"
    rental ||--o{ payment_p2007_05 : "payment_p2007_05_rental_id_fkey"
    rental ||--o{ payment_p2007_06 : "payment_p2007_06_rental_id_fkey"
    customer ||--o{ rental : "rental_customer_id_fkey"
    inventory ||--o{ rental : "rental_inventory_id_fkey"
    staff ||--o{ rental : "rental_staff_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
rental_idintegernextval('rental_rental_id_seq'::regclass)
rental_datetimestamp without time zone
inventory_idinteger
customer_idsmallint
return_datetimestamp without time zone
staff_idsmallint
last_updatetimestamp without time zonenow()
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
customer_id customer.customer_idrental_customer_id_fkeycascaderestrict
inventory_id inventory.inventory_idrental_inventory_id_fkeycascaderestrict
staff_id staff.staff_idrental_staff_id_fkeycascaderestrict
rental_id payment_p2007_01.rental_idpayment_p2007_01_rental_id_fkey
rental_id payment_p2007_02.rental_idpayment_p2007_02_rental_id_fkey
rental_id payment_p2007_03.rental_idpayment_p2007_03_rental_id_fkey
rental_id payment_p2007_04.rental_idpayment_p2007_04_rental_id_fkey
rental_id payment_p2007_05.rental_idpayment_p2007_05_rental_id_fkey
rental_id payment_p2007_06.rental_idpayment_p2007_06_rental_id_fkey
rental_id payment.rental_idpayment_rental_id_fkeycascadeset null
Indexes
IndexColumnsUniquePrimaryType
idx_fk_inventory_idinventory_idbtree
idx_unq_rental_rental_date_inventory_id_customer_idrental_date, inventory_id, customer_idbtree
rental_pkeyrental_idbtree

staff

table · 2 rows · 32.0KB

Entity Relationship Diagram

erDiagram
    staff {
        int staff_id PK
        text first_name
        text last_name
        int address_id FK
        text email
        int store_id FK
        bool active
        text username
        text password
        datetime last_update
        bytes picture
    }
    staff ||--o{ payment : "payment_staff_id_fkey"
    staff ||--o{ payment_p2007_01 : "payment_p2007_01_staff_id_fkey"
    staff ||--o{ payment_p2007_02 : "payment_p2007_02_staff_id_fkey"
    staff ||--o{ payment_p2007_03 : "payment_p2007_03_staff_id_fkey"
    staff ||--o{ payment_p2007_04 : "payment_p2007_04_staff_id_fkey"
    staff ||--o{ payment_p2007_05 : "payment_p2007_05_staff_id_fkey"
    staff ||--o{ payment_p2007_06 : "payment_p2007_06_staff_id_fkey"
    staff ||--o{ rental : "rental_staff_id_fkey"
    address ||--o{ staff : "staff_address_id_fkey"
    store ||--o{ staff : "staff_store_id_fkey"
    staff ||--o{ store : "store_manager_staff_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
staff_idintegernextval('staff_staff_id_seq'::regclass)
first_namecharacter varying
last_namecharacter varying
address_idsmallint
emailcharacter varying
store_idsmallint
activebooleantrue
usernamecharacter varying
passwordcharacter varying
last_updatetimestamp without time zonenow()
picturebytea
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
address_id address.address_idstaff_address_id_fkeycascaderestrict
store_id store.store_idstaff_store_id_fkey
staff_id payment_p2007_01.staff_idpayment_p2007_01_staff_id_fkey
staff_id payment_p2007_02.staff_idpayment_p2007_02_staff_id_fkey
staff_id payment_p2007_03.staff_idpayment_p2007_03_staff_id_fkey
staff_id payment_p2007_04.staff_idpayment_p2007_04_staff_id_fkey
staff_id payment_p2007_05.staff_idpayment_p2007_05_staff_id_fkey
staff_id payment_p2007_06.staff_idpayment_p2007_06_staff_id_fkey
staff_id payment.staff_idpayment_staff_id_fkeycascaderestrict
staff_id rental.staff_idrental_staff_id_fkeycascaderestrict
staff_id store.manager_staff_idstore_manager_staff_id_fkeycascaderestrict
Indexes
IndexColumnsUniquePrimaryType
staff_pkeystaff_idbtree

store

table · 2 rows · 40.0KB

Entity Relationship Diagram

erDiagram
    store {
        int store_id PK
        int manager_staff_id FK
        int address_id FK
        datetime last_update
    }
    store ||--o{ customer : "customer_store_id_fkey"
    store ||--o{ inventory : "inventory_store_id_fkey"
    store ||--o{ staff : "staff_store_id_fkey"
    address ||--o{ store : "store_address_id_fkey"
    staff ||--o{ store : "store_manager_staff_id_fkey"
Columns
ColumnTypeNullablePKFKDefault
store_idintegernextval('store_store_id_seq'::regclass)
manager_staff_idsmallint
address_idsmallint
last_updatetimestamp without time zonenow()
Foreign keys
Relationship ( references · referenced by)ConstraintOn updateOn delete
address_id address.address_idstore_address_id_fkeycascaderestrict
manager_staff_id staff.staff_idstore_manager_staff_id_fkeycascaderestrict
store_id customer.store_idcustomer_store_id_fkeycascaderestrict
store_id inventory.store_idinventory_store_id_fkeycascaderestrict
store_id staff.store_idstaff_store_id_fkey
Indexes
IndexColumnsUniquePrimaryType
idx_unq_manager_staff_idmanager_staff_idbtree
store_pkeystore_idbtree

actor_info

view · 200 rows

Entity Relationship Diagram

erDiagram
    actor_info {
        int actor_id
        text first_name
        text last_name
        text film_info
    }
Columns
ColumnTypeNullablePKFK
actor_idinteger
first_namecharacter varying
last_namecharacter varying
film_infotext

customer_list

view · 599 rows

Entity Relationship Diagram

erDiagram
    customer_list {
        int id
        text name
        text address
        text zip_code
        text phone
        text city
        text country
        text notes
        int sid
    }
Columns
ColumnTypeNullablePKFK
idinteger
nametext
addresscharacter varying
zip codecharacter varying
phonecharacter varying
citycharacter varying
countrycharacter varying
notestext
sidsmallint

film_list

view · 997 rows

Entity Relationship Diagram

erDiagram
    film_list {
        int fid
        text title
        text description
        text category
        decimal price
        int length
        unknown rating
        text actors
    }
Columns
ColumnTypeNullablePKFK
fidinteger
titlecharacter varying
descriptiontext
categorycharacter varying
pricenumeric
lengthsmallint
ratingUSER-DEFINED
actorstext

nicer_but_slower_film_list

view · 997 rows

Entity Relationship Diagram

erDiagram
    nicer_but_slower_film_list {
        int fid
        text title
        text description
        text category
        decimal price
        int length
        unknown rating
        text actors
    }
Columns
ColumnTypeNullablePKFK
fidinteger
titlecharacter varying
descriptiontext
categorycharacter varying
pricenumeric
lengthsmallint
ratingUSER-DEFINED
actorstext

sales_by_film_category

view · 16 rows

Entity Relationship Diagram

erDiagram
    sales_by_film_category {
        text category
        decimal total_sales
    }
Columns
ColumnTypeNullablePKFK
categorycharacter varying
total_salesnumeric

sales_by_store

view · 2 rows

Entity Relationship Diagram

erDiagram
    sales_by_store {
        text store
        text manager
        decimal total_sales
    }
Columns
ColumnTypeNullablePKFK
storetext
managertext
total_salesnumeric

staff_list

view · 2 rows

Entity Relationship Diagram

erDiagram
    staff_list {
        int id
        text name
        text address
        text zip_code
        text phone
        text city
        text country
        int sid
    }
Columns
ColumnTypeNullablePKFK
idinteger
nametext
addresscharacter varying
zip codecharacter varying
phonecharacter varying
citycharacter varying
countrycharacter varying
sidsmallint