0% found this document useful (0 votes)
243 views3 pages

Sakila Model

This document outlines the database schema for a movie rental store, including tables for films, film categories, actors, addresses, cities, countries, customers, payments, rentals, staff, and stores. The tables track basic information like IDs, names, dates as well as store specific information like film length and rental rates. Relationships between the tables like film_category and film_actor are defined through indexes and triggers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
243 views3 pages

Sakila Model

This document outlines the database schema for a movie rental store, including tables for films, film categories, actors, addresses, cities, countries, customers, payments, rentals, staff, and stores. The tables track basic information like IDs, names, dates as well as store specific information like film length and rental rates. Relationships between the tables like film_category and film_actor are defined through indexes and triggers.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

film

film_id SMALLINT(5)
title VARCHAR(255)
description TEXT
release_year YEAR
language_id TINYINT(3)
original_language_id TINYINT(3)
rental_duration TINYINT(3)
rental_rate DECIMAL(4,2)
length SMALLINT(5)
replacement_cost DECIMAL(5,2)

country

actor_id SMALLINT(5)

country_id SMALLINT(5)

special_features SET(...)

film_id SMALLINT(5)

country VARCHAR(50)

last_update TIMESTAMP

last_update TIMESTAMP

Indexes

language

film_actor

rating ENUM(...)

Indexes

film_list

last_update TIMESTAMP
Indexes

Triggers

language_id TINYINT(3)
name CHAR(20)
last_update TIMESTAMP

film_text

Indexes

film_id SMALLINT(6)

inventory

title VARCHAR(255)

payment
payment_id SMALLINT(5)
customer_id SMALLINT(5)
staff_id TINYINT(3)

Indexes

rental_id INT(11)

city

film_category

inventory_id MEDIUMINT(8)

city_id SMALLINT(5)

film_id SMALLINT(5)

film_id SMALLINT(5)

city VARCHAR(50)

category_id TINYINT(3)

store_id TINYINT(3)

last_update TIMESTAMP

last_update TIMESTAMP

country_id SMALLINT(5)

description TEXT

Indexes

last_update TIMESTAMP
Indexes

Indexes

amount DECIMAL(5,2)
payment_date DATETIME
last_update TIMESTAMP
Indexes

sales_by_film_category

Triggers

staff
staff_id TINYINT(3)
first_name VARCHAR(45)
last_name VARCHAR(45)
picture BLOB

username VARCHAR(16)
password VARCHAR(40)
last_update TIMESTAMP
store_id TINYINT(3)
address_id SMALLINT(5)

address VARCHAR(50)

rental_date DATETIME

first_name VARCHAR(45)

address2 VARCHAR(50)

inventory_id MEDIUMINT(8)

last_name VARCHAR(45)

district VARCHAR(20)

customer_id SMALLINT(5)

postal_code VARCHAR(10)

return_date DATETIME

phone VARCHAR(20)

staff_id TINYINT(3)

Indexes

nicer_but_slower_film_list

actor
actor_id SMALLINT(5)

city_id SMALLINT(5)

active TINYINT(1)

rental
rental_id INT(11)

last_update TIMESTAMP

email VARCHAR(50)

actor_info

address
address_id SMALLINT(5)

last_update TIMESTAMP
Indexes

last_update TIMESTAMP
Indexes
Triggers

staff_list

store

customer

store_id TINYINT(3)

customer_id SMALLINT(5)

manager_staff_id TINYINT(3)

store_id TINYINT(3)

address_id SMALLINT(5)

first_name VARCHAR(45)

last_update TIMESTAMP

last_name VARCHAR(45)

Indexes

email VARCHAR(50)
address_id SMALLINT(5)
active TINYINT(1)
create_date DATETIME
last_update TIMESTAMP

category
category_id TINYINT(3)
name VARCHAR(25)
last_update TIMESTAMP
Indexes

sales_by_store

Indexes
Triggers

customer_list

You might also like