Movie rental database playground 🍿

  col_name   | col_type
-------------+--------------------------
 actor_id    | integer
 first_name  | text
 last_name   | text
  

Actors who appeared in a movie.

  col_name  | col_type
------------+-------------------
 actor_id   | integer
 first_name | character varying
 last_name  | character varying
  

Actors who appeared in a TV show.

  col_name  | col_type
------------+-------------------
 actor_id   | integer
 first_name | character varying
 last_name  | character varying
  

  col_name   | col_type
-------------+--------------------------
 address_id  | integer
 address     | text
 address2    | text
 district    | text
 city_id     | smallint
 postal_code | text
 phone       | text
 last_update | timestamp with time zone
  

Movie categories.

  col_name   | col_type
-------------+--------------------------
 category_id | integer
 name        | text
 last_update | timestamp with time zone
  

  col_name   | col_type
-------------+--------------------------
 city_id     | integer
 city        | text
 country_id  | smallint
 last_update | timestamp with time zone
  

  col_name   | col_type
-------------+--------------------------
 customer_id | integer
 store_id    | smallint
 first_name  | text
 last_name   | text
 email       | text
 address_id  | smallint
 activebool  | boolean
 create_date | date
 last_update | timestamp with time zone
 active      | integer
  

Dates from 01/01/2019 to 12/31/2021.

 col_name | col_type
----------+----------
 year     | smallint
 month    | smallint
 date     | date
  

       col_name       |  col_type
----------------------+--------------------------
 film_id              | integer
 title                | text
 description          | text
 release_year         | integer
 language_id          | smallint
 original_language_id | smallint
 rental_duration      | smallint
 rental_rate          | numeric
 length               | smallint
 replacement_cost     | numeric
 rating               | USER-DEFINED
 last_update          | timestamp with time zone
  

Films and their casts

  col_name   | col_type
-------------+--------------------------
 actor_id    | smallint
 film_id     | smallint
 last_update | timestamp with time zone
  

A film can only belong to one category

  col_name   | col_type
-------------+--------------------------
 film_id     | smallint
 category_id | smallint
 last_update | timestamp with time zone
  

Each row is unique; Inventoy_id is the primary key of the table

   col_name   | col_type
--------------+--------------------------
 inventory_id | integer
 film_id      | smallint
 store_id     | smallint
 last_update  | timestamp with time zone
  

Movie rental payment transactions table

   col_name   | col_type
--------------+--------------------------
 payment_id   | integer
 customer_id  | smallint
 staff_id     | smallint
 rental_id    | integer
 amount       | numeric
 payment_ts   | timestamp with time zone
  

   col_name   | col_type
--------------+--------------------------
 rental_id    | integer
 rental_ts    | timestamp with time zone
 inventory_id | integer
 customer_id  | smallint
 return_ts    | timestamp with time zone
 staff_id     | smallint
 last_update  | timestamp with time zone
  

Total sales by movie categories.

  col_name   | col_type
-------------+----------
 category    | text
 total_sales | numeric
  

Movie sales by store

  col_name   | col_type
-------------+----------
 store       | text
 manager     | text
 total_sales | numeric
  

  col_name   | col_type
-------------+--------------------------
 staff_id    | integer
 first_name  | text
 last_name   | text
 address_id  | smallint
 email       | text
 store_id    | smallint
 active      | boolean
 username    | text
 last_update | timestamp with time zone
 picture     | character varying
  

 col_name | col_type
----------+----------
 id       | integer
 name     | text
 address  | text
 zip code | text
 phone    | text
 city     | text
 country  | text
 sid      | smallint