- Server: PostgreSQL
localhost:5432
, version13.8 (Ubuntu 13.8-1.pgdg20.04+1)
- Local time stamp:
2022-12-28T14:21:53.0587893+01:00
- Schema:
public
- Table
public.actor
- Table
public.address
- Table
public.category
- Table
public.city
- Table
public.country
- Table
public.customer
- Table
public.film
- Table
public.film_actor
- Table
public.film_category
- Table
public.inventory
- Table
public.language
- Table
public.payment
- Table
public.rental
- Table
public.staff
- Table
public.store
- View
public.actor_info
- View
public.customer_list
- View
public.film_list
- View
public.nicer_but_slower_film_list
- View
public.sales_by_film_category
- View
public.sales_by_store
- View
public.staff_list
- Enum
public.mpaa_rating
- Function
public._group_concat()
- Function
public.film_in_stock(p_film_id integer, p_store_id integer)
- Function
public.film_not_in_stock(p_film_id integer, p_store_id integer)
- Function
public.get_customer_balance(p_customer_id integer, p_effective_date timestamp without time zone)
- Function
public.inventory_held_by_customer(p_inventory_id integer)
- Function
public.inventory_in_stock(p_inventory_id integer)
- Function
public.last_day()
- Function
public.last_updated()
- Function
public.rewards_report(min_monthly_purchases integer, min_dollar_amount_purchased numeric)
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#actor_id |
PK | integer |
NO | nextval('actor_actor_id_seq'::regclass) |
|
#first_name |
character varying(45) |
NO | |||
#last_name |
IDX | character varying(45) |
NO | ||
#last_update |
timestamp without time zone |
NO | now() |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#address_id |
PK | integer |
NO | nextval('address_address_id_seq'::regclass) |
|
#address |
character varying(50) |
NO | |||
#address2 |
character varying(50) |
YES | |||
#district |
character varying(20) |
NO | |||
#city_id |
FK ➝ city.city_id , IDX |
smallint |
NO | ||
#postal_code |
character varying(10) |
YES | |||
#phone |
character varying(20) |
NO | |||
#last_update |
timestamp without time zone |
NO | now() |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#category_id |
PK | integer |
NO | nextval('category_category_id_seq'::regclass) |
|
#name |
character varying(25) |
NO | |||
#last_update |
timestamp without time zone |
NO | now() |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#city_id |
PK | integer |
NO | nextval('city_city_id_seq'::regclass) |
|
#city |
character varying(50) |
NO | |||
#country_id |
FK ➝ country.country_id , IDX |
smallint |
NO | ||
#last_update |
timestamp without time zone |
NO | now() |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#country_id |
PK | integer |
NO | nextval('country_country_id_seq'::regclass) |
|
#country |
character varying(50) |
NO | |||
#last_update |
timestamp without time zone |
NO | now() |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#customer_id |
PK | integer |
NO | nextval('customer_customer_id_seq'::regclass) |
|
#store_id |
IDX | smallint |
NO | ||
#first_name |
character varying(45) |
NO | |||
#last_name |
IDX | character varying(45) |
NO | ||
#email |
character varying(50) |
YES | |||
#address_id |
FK ➝ address.address_id , IDX |
smallint |
NO | ||
#activebool |
boolean |
NO | true |
||
#create_date |
date |
NO | ('now'::text)::date |
||
#last_update |
timestamp without time zone |
YES | now() |
||
#active |
integer |
YES |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#film_id |
PK | integer |
NO | nextval('film_film_id_seq'::regclass) |
|
#title |
IDX | character varying(255) |
NO | ||
#description |
text |
YES | |||
#release_year |
integer |
YES | |||
#language_id |
FK ➝ language.language_id , IDX |
smallint |
NO | ||
#rental_duration |
smallint |
NO | 3 |
||
#rental_rate |
numeric(4,2) |
NO | 4.99 |
||
#length |
smallint |
YES | |||
#replacement_cost |
numeric(5,2) |
NO | 19.99 |
||
#rating |
mpaa_rating user defined AS ENUM ('G', 'PG', 'PG-13', 'R', 'NC-17') ➝ |
YES | 'G'::mpaa_rating |
||
#last_update |
timestamp without time zone |
NO | now() |
||
#special_features |
text[] |
YES | |||
#fulltext |
IDX | tsvector |
NO |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#actor_id |
FK ➝ actor.actor_id |
smallint |
NO | ||
#actor_id |
PK | smallint |
NO | ||
#film_id |
FK ➝ film.film_id , IDX |
smallint |
NO | ||
#film_id |
PK | smallint |
NO | ||
#last_update |
timestamp without time zone |
NO | now() |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#film_id |
FK ➝ film.film_id |
smallint |
NO | ||
#film_id |
PK | smallint |
NO | ||
#category_id |
FK ➝ category.category_id |
smallint |
NO | ||
#category_id |
PK | smallint |
NO | ||
#last_update |
timestamp without time zone |
NO | now() |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#inventory_id |
PK | integer |
NO | nextval('inventory_inventory_id_seq'::regclass) |
|
#film_id |
FK ➝ film.film_id , IDX |
smallint |
NO | ||
#store_id |
IDX | smallint |
NO | ||
#last_update |
timestamp without time zone |
NO | now() |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#language_id |
PK | integer |
NO | nextval('language_language_id_seq'::regclass) |
|
#name |
character(20) |
NO | |||
#last_update |
timestamp without time zone |
NO | now() |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#payment_id |
PK | integer |
NO | nextval('payment_payment_id_seq'::regclass) |
|
#customer_id |
FK ➝ customer.customer_id , IDX |
smallint |
NO | ||
#staff_id |
FK ➝ staff.staff_id , IDX |
smallint |
NO | ||
#rental_id |
FK ➝ rental.rental_id , IDX |
integer |
NO | ||
#amount |
numeric(5,2) |
NO | |||
#payment_date |
timestamp without time zone |
NO |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#rental_id |
PK | integer |
NO | nextval('rental_rental_id_seq'::regclass) |
|
#rental_date |
IDX | timestamp without time zone |
NO | ||
#inventory_id |
FK ➝ inventory.inventory_id , IDX, IDX |
integer |
NO | ||
#customer_id |
FK ➝ customer.customer_id , IDX |
smallint |
NO | ||
#return_date |
timestamp without time zone |
YES | |||
#staff_id |
FK ➝ staff.staff_id |
smallint |
NO | ||
#last_update |
timestamp without time zone |
NO | now() |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#staff_id |
PK | integer |
NO | nextval('staff_staff_id_seq'::regclass) |
|
#first_name |
character varying(45) |
NO | |||
#last_name |
character varying(45) |
NO | |||
#address_id |
FK ➝ address.address_id |
smallint |
NO | ||
#email |
character varying(50) |
YES | |||
#store_id |
smallint |
NO | |||
#active |
boolean |
NO | true |
||
#username |
character varying(16) |
NO | |||
#password |
character varying(40) |
YES | |||
#last_update |
timestamp without time zone |
NO | now() |
||
#picture |
bytea |
YES |
Column | Type | Nullable | Default | Comment | |
---|---|---|---|---|---|
#store_id |
PK | integer |
NO | nextval('store_store_id_seq'::regclass) |
|
#manager_staff_id |
FK ➝ staff.staff_id , IDX |
smallint |
NO | ||
#address_id |
FK ➝ address.address_id |
smallint |
NO | ||
#last_update |
timestamp without time zone |
NO | now() |
Column | Type | Comment |
---|---|---|
actor_id |
integer |
|
first_name |
character varying(45) |
|
last_name |
character varying(45) |
|
film_info |
text |
Column | Type | Comment |
---|---|---|
id |
integer |
|
name |
text |
|
address |
character varying(50) |
|
zip code |
character varying(10) |
|
phone |
character varying(20) |
|
city |
character varying(50) |
|
country |
character varying(50) |
|
notes |
text |
|
sid |
smallint |
Column | Type | Comment |
---|---|---|
fid |
integer |
|
title |
character varying(255) |
|
description |
text |
|
category |
character varying(25) |
|
price |
numeric(4,2) |
|
length |
smallint |
|
rating |
mpaa_rating user defined AS ENUM ('G', 'PG', 'PG-13', 'R', 'NC-17') ➝ |
|
actors |
text |
Column | Type | Comment |
---|---|---|
fid |
integer |
|
title |
character varying(255) |
|
description |
text |
|
category |
character varying(25) |
|
price |
numeric(4,2) |
|
length |
smallint |
|
rating |
mpaa_rating user defined AS ENUM ('G', 'PG', 'PG-13', 'R', 'NC-17') ➝ |
|
actors |
text |
Column | Type | Comment |
---|---|---|
category |
character varying(25) |
|
total_sales |
numeric |
Column | Type | Comment |
---|---|---|
store |
text |
|
manager |
text |
|
total_sales |
numeric |
Column | Type | Comment |
---|---|---|
id |
integer |
|
name |
text |
|
address |
character varying(50) |
|
zip code |
character varying(10) |
|
phone |
character varying(20) |
|
city |
character varying(50) |
|
country |
character varying(50) |
|
sid |
smallint |
Type name | Values | Comment |
---|---|---|
#public.mpaa_rating |
'G', 'PG', 'PG-13', 'R', 'NC-17' |
-
Returns
text
-
Language is
sql
-
Returns
integer
-
Language is
sql
-
Returns
integer
-
Language is
sql
Function public.get_customer_balance(p_customer_id integer, p_effective_date timestamp without time zone)
-
Returns
numeric
-
Language is
plpgsql
-
Returns
integer
-
Language is
plpgsql
-
Returns
boolean
-
Language is
plpgsql
-
Returns
date
-
Language is
sql
-
Returns
trigger
-
Language is
plpgsql
-
Returns
setof customer
-
Language is
plpgsql