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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"
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"