1 Sample Diagram Read table & column comments as mouse-over tooltips. Fk fk_film_language film ref language ( language_id ) language_id Fk fk_film_language_original film ref language ( original_language_id -> language_id ) original_language_id Fk fk_film_actor_actor film_actor ref actor ( actor_id ) actor_id Fk fk_film_actor_film film_actor ref film ( film_id ) film_id Fk fk_film_category_category film_category ref category ( category_id ) category_id Fk fk_film_category_film film_category ref film ( film_id ) film_id Fk fk_inventory_film inventory ref film ( film_id ) film_id Fk fk_inventory_store inventory ref store ( store_id ) store_id Fk FK_CITY_COUNTRY city ref country ( country_id ) country_id Fk fk_staff_address staff ref address ( address_id ) address_id Fk fk_payment_customer payment ref customer ( customer_id ) customer_id Fk fk_payment_rental payment ref rental ( rental_id ) rental_id Fk fk_payment_staff payment ref staff ( staff_id ) staff_id Fk fk_customer_address customer ref address ( address_id ) address_id Fk fk_customer_store customer ref store ( store_id ) store_id Fk fk_store_address store ref address ( address_id ) address_id Fk fk_store_staff store ref staff ( manager_staff_id -> staff_id ) manager_staff_id Fk fk_rental_customer rental ref customer ( customer_id ) customer_id Fk fk_rental_inventory rental ref inventory ( inventory_id ) inventory_id Fk fk_rental_staff rental ref staff ( staff_id ) staff_id countryTable SAKILA.country Pk CONSTRAINT_39 ( country_id ) country_idcountry_id * smallint default (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_59812272_EFB2_4592_91C6_CBBA3E3F31D1) Referred by city ( country_id ) countrycountry * varchar(50) t last_updatelast_update * timestamp default CURRENT_TIMESTAMP() d filmTable SAKILA.film Pk CONSTRAINT_2F ( film_id ) film_idfilm_id * smallint default (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_BC33AE5C_DBCD_4807_A088_05B607952201) Referred by film_actor ( film_id ) Referred by film_category ( film_id ) Referred by inventory ( film_id ) titletitle * varchar(255) t descriptiondescription clob(2147483647) ~ release_yearrelease_year smallint # fk_film_language_INDEX_2 ( language_id ) language_idlanguage_id * tinyint References language ( language_id ) fk_film_language_original_INDEX_2 ( original_language_id ) original_language_idoriginal_language_id tinyint References language ( original_language_id -> language_id ) rental_durationrental_duration * tinyint default 3 # rental_raterental_rate * decimal(4) default 4.99 # lengthlength smallint # replacement_costreplacement_cost * decimal(5) default 19.99 # ratingrating char(5) default 'G' c special_featuresspecial_features varchar(255) t last_updatelast_update * timestamp default CURRENT_TIMESTAMP() d film_actorTable SAKILA.film_actor Pk CONSTRAINT_25 ( actor_id, film_id ) actor_idactor_id * smallint References actor ( actor_id ) Pk CONSTRAINT_25 ( actor_id, film_id ) fk_film_actor_film_INDEX_2 ( film_id ) film_idfilm_id * smallint References film ( film_id ) last_updatelast_update * timestamp default CURRENT_TIMESTAMP() d actorTable SAKILA.actor Pk CONSTRAINT_5 ( actor_id ) actor_idactor_id * smallint default (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_F0A592BF_F4B1_42B3_A6D4_29DA739691AC) Referred by film_actor ( actor_id ) first_namefirst_name * varchar(45) t last_namelast_name * varchar(45) t last_updatelast_update * timestamp default CURRENT_TIMESTAMP() d film_categoryTable SAKILA.film_category Pk CONSTRAINT_C ( film_id, category_id ) film_idfilm_id * smallint References film ( film_id ) Pk CONSTRAINT_C ( film_id, category_id ) fk_film_category_category_INDEX_C ( category_id ) category_idcategory_id * tinyint References category ( category_id ) last_updatelast_update * timestamp default CURRENT_TIMESTAMP() d categoryTable SAKILA.category Pk CONSTRAINT_3 ( category_id ) category_idcategory_id * tinyint default (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_76A96B9F_E056_41F1_AD92_6BFB6B6C012D) Referred by film_category ( category_id ) namename * varchar(25) t last_updatelast_update * timestamp default CURRENT_TIMESTAMP() d inventoryTable SAKILA.inventory Pk CONSTRAINT_8 ( inventory_id ) inventory_idinventory_id * integer default (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_C0A99734_1333_48B4_A39C_43A6370B0AE3) Referred by rental ( inventory_id ) fk_inventory_film_INDEX_8 ( film_id ) film_idfilm_id * smallint References film ( film_id ) fk_inventory_store_INDEX_8 ( store_id ) store_idstore_id * tinyint References store ( store_id ) last_updatelast_update * timestamp default CURRENT_TIMESTAMP() d languageTable SAKILA.language Pk CONSTRAINT_9 ( language_id ) language_idlanguage_id * tinyint default (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_AA419FF8_25F5_43DD_BC48_4837520C03B1) Referred by film ( language_id ) Referred by film ( original_language_id -> language_id ) namename * char(20) c last_updatelast_update * timestamp default CURRENT_TIMESTAMP() d staff_listView SAKILA.staff_list IDID tinyint # namename varchar t addressaddress varchar t ZIP_CODEZIP_CODE varchar t phonephone varchar t citycity varchar t countrycountry varchar t SIDSID tinyint # actor_infoView SAKILA.actor_info actor_idactor_id smallint # first_namefirst_name varchar t last_namelast_name varchar t film_infofilm_info varchar t film_textTable SAKILA.film_text Pk CONSTRAINT_BF ( film_id ) film_idfilm_id * smallint # titletitle * varchar(255) t descriptiondescription clob(2147483647) ~ cityTable SAKILA.city Pk CONSTRAINT_2 ( city_id ) city_idcity_id * smallint default (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_222AEAC7_C7F4_4EC8_B74B_4ADD186B2EC1) # citycity * varchar(50) t FK_CITY_COUNTRY_INDEX_2 ( country_id ) country_idcountry_id * smallint References country ( country_id ) last_updatelast_update * timestamp default CURRENT_TIMESTAMP() d staffTable SAKILA.staff Pk CONSTRAINT_6 ( staff_id ) staff_idstaff_id * tinyint default (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_610519DD_8738_4474_9E37_D41878EF4B9E) Referred by payment ( staff_id ) Referred by rental ( staff_id ) Referred by store ( manager_staff_id -> staff_id ) first_namefirst_name * varchar(45) t last_namelast_name * varchar(45) t fk_staff_address_INDEX_6 ( address_id ) address_idaddress_id * smallint References address ( address_id ) picturepicture blob(2147483647) ~ emailemail varchar(50) t store_idstore_id * tinyint # activeactive * boolean default TRUE b usernameusername * varchar(16) t passwordpassword varchar(40) t last_updatelast_update * timestamp default CURRENT_TIMESTAMP() d paymentTable SAKILA.payment Pk CONSTRAINT_D ( payment_id ) payment_idpayment_id * smallint default (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_3AA7B3B6_06F1_4A38_9E91_64410B2988E9) # fk_payment_customer_INDEX_D ( customer_id ) customer_idcustomer_id * smallint References customer ( customer_id ) fk_payment_staff_INDEX_D ( staff_id ) staff_idstaff_id * tinyint References staff ( staff_id ) fk_payment_rental_INDEX_D ( rental_id ) rental_idrental_id integer References rental ( rental_id ) amountamount * decimal(5) # payment_datepayment_date * timestamp d last_updatelast_update timestamp default CURRENT_TIMESTAMP() d customerTable SAKILA.customer Pk CONSTRAINT_24 ( customer_id ) customer_idcustomer_id * smallint default (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_9B3A964B_2B9B_4EB7_A124_D26EB1622961) Referred by payment ( customer_id ) Referred by rental ( customer_id ) fk_customer_store_INDEX_2 ( store_id ) store_idstore_id * tinyint References store ( store_id ) first_namefirst_name * varchar(45) t last_namelast_name * varchar(45) t emailemail varchar(50) t fk_customer_address_INDEX_2 ( address_id ) address_idaddress_id * smallint References address ( address_id ) activeactive * boolean default TRUE b create_datecreate_date * timestamp d last_updatelast_update timestamp default CURRENT_TIMESTAMP() d addressTable SAKILA.address Pk CONSTRAINT_B ( address_id ) address_idaddress_id * smallint default (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_664F6DF3_6AD6_4615_9E93_B7A9DEF09EA9) Referred by customer ( address_id ) Referred by staff ( address_id ) Referred by store ( address_id ) addressaddress * varchar(50) t address2address2 varchar(50) t districtdistrict * varchar(20) t city_idcity_id * smallint # postal_codepostal_code varchar(10) t phonephone * varchar(20) t last_updatelast_update * timestamp default CURRENT_TIMESTAMP() d storeTable SAKILA.store Pk CONSTRAINT_68 ( store_id ) store_idstore_id * tinyint default (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_77628EA6_6894_4132_88FC_1D9EF43F5EC5) Referred by customer ( store_id ) Referred by inventory ( store_id ) fk_store_staff_INDEX_6 ( manager_staff_id ) manager_staff_idmanager_staff_id * tinyint References staff ( manager_staff_id -> staff_id ) fk_store_address_INDEX_6 ( address_id ) address_idaddress_id * smallint References address ( address_id ) last_updatelast_update * timestamp default CURRENT_TIMESTAMP() d rentalTable SAKILA.rental Pk CONSTRAINT_C8 ( rental_id ) rental_idrental_id * integer default (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_34E11AA7_67CE_44AD_84D5_269AE16763EE) Referred by payment ( rental_id ) Unq CONSTRAINT_INDEX_C ( rental_date, inventory_id, customer_id ) rental_daterental_date * timestamp d Unq CONSTRAINT_INDEX_C ( rental_date, inventory_id, customer_id ) fk_rental_inventory_INDEX_C ( inventory_id ) inventory_idinventory_id * integer References inventory ( inventory_id ) Unq CONSTRAINT_INDEX_C ( rental_date, inventory_id, customer_id ) fk_rental_customer_INDEX_C ( customer_id ) customer_idcustomer_id * smallint References customer ( customer_id ) return_datereturn_date timestamp d fk_rental_staff_INDEX_C ( staff_id ) staff_idstaff_id * tinyint References staff ( staff_id ) last_updatelast_update * timestamp default CURRENT_TIMESTAMP() d sales_by_storeView SAKILA.sales_by_store storestore varchar t managermanager varchar t total_salestotal_sales decimal # film_listView SAKILA.film_list FIDFID smallint # titletitle varchar t descriptiondescription clob ~ categorycategory varchar t priceprice decimal # lengthlength smallint # ratingrating char c actorsactors varchar t customer_listView SAKILA.customer_list IDID smallint # namename varchar t addressaddress varchar t ZIP_CODEZIP_CODE varchar t phonephone varchar t citycity varchar t countrycountry varchar t notesnotes boolean b SIDSID tinyint # sales_by_film_categoryView SAKILA.sales_by_film_category categorycategory varchar t total_salestotal_sales decimal # This sample is using animation. This works only on latest version browsers. If you use an older browser click here.   For each table and column you can add comments in DbSchema. Here you can read them as mouse-over tooltips.


Table actor

IndexesField NameData TypeDescription
* actor_id smallint DEFAULT (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_F0A592BF_F4B1_42B3_A6D4_29DA739691AC)
* first_name varchar( 45 )
* last_name varchar( 45 )
* last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_5 ON actor_id


Table address

IndexesField NameData TypeDescription
* address_id smallint DEFAULT (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_664F6DF3_6AD6_4615_9E93_B7A9DEF09EA9)
* address varchar( 50 )
  address2 varchar( 50 )
* district varchar( 20 )
* city_id smallint
  postal_code varchar( 10 )
* phone varchar( 20 )
* last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_B ON address_id


Table category

IndexesField NameData TypeDescription
* category_id tinyint DEFAULT (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_76A96B9F_E056_41F1_AD92_6BFB6B6C012D)
* name varchar( 25 )
* last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_3 ON category_id


Table city

IndexesField NameData TypeDescription
* city_id smallint DEFAULT (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_222AEAC7_C7F4_4EC8_B74B_4ADD186B2EC1)
* city varchar( 50 )
* country_id smallint
* last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_2 ON city_id
FK_CITY_COUNTRY_INDEX_2 ON country_id
Foreign Keys
FK_CITY_COUNTRY ( country_id ) ref country (country_id)


Table country

IndexesField NameData TypeDescription
* country_id smallint DEFAULT (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_59812272_EFB2_4592_91C6_CBBA3E3F31D1)
* country varchar( 50 )
* last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_39 ON country_id


Table customer

IndexesField NameData TypeDescription
* customer_id smallint DEFAULT (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_9B3A964B_2B9B_4EB7_A124_D26EB1622961)
* store_id tinyint
* first_name varchar( 45 )
* last_name varchar( 45 )
  email varchar( 50 )
* address_id smallint
* active boolean DEFAULT TRUE
* create_date timestamp
  last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_24 ON customer_id
fk_customer_address_INDEX_2 ON address_id
fk_customer_store_INDEX_2 ON store_id
Foreign Keys
fk_customer_address ( address_id ) ref address (address_id)
fk_customer_store ( store_id ) ref store (store_id)


Table film

IndexesField NameData TypeDescription
* film_id smallint DEFAULT (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_BC33AE5C_DBCD_4807_A088_05B607952201)
* title varchar( 255 )
  description clob( 2147483647 )
  release_year smallint
* language_id tinyint
original_language_id tinyint
* rental_duration tinyint DEFAULT 3
* rental_rate decimal( 4 ) DEFAULT 4.99
  length smallint
* replacement_cost decimal( 5 ) DEFAULT 19.99
  rating char( 5 ) DEFAULT 'G'
  special_features varchar( 255 )
* last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_2F ON film_id
fk_film_language_INDEX_2 ON language_id
fk_film_language_original_INDEX_2 ON original_language_id
Foreign Keys
fk_film_language ( language_id ) ref language (language_id)
fk_film_language_original ( original_language_id ) ref language (language_id)


Table film_actor

IndexesField NameData TypeDescription
* actor_id smallint
* film_id smallint
* last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_25 ON actor_id, film_id
fk_film_actor_film_INDEX_2 ON film_id
Foreign Keys
fk_film_actor_actor ( actor_id ) ref actor (actor_id)
fk_film_actor_film ( film_id ) ref film (film_id)


Table film_category

IndexesField NameData TypeDescription
* film_id smallint
* category_id tinyint
* last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_C ON film_id, category_id
fk_film_category_category_INDEX_C ON category_id
Foreign Keys
fk_film_category_category ( category_id ) ref category (category_id)
fk_film_category_film ( film_id ) ref film (film_id)


Table film_text

IndexesField NameData TypeDescription
* film_id smallint
* title varchar( 255 )
  description clob( 2147483647 )
Indexes
CONSTRAINT_BF ON film_id


Table inventory

IndexesField NameData TypeDescription
* inventory_id integer DEFAULT (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_C0A99734_1333_48B4_A39C_43A6370B0AE3)
* film_id smallint
* store_id tinyint
* last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_8 ON inventory_id
fk_inventory_film_INDEX_8 ON film_id
fk_inventory_store_INDEX_8 ON store_id
Foreign Keys
fk_inventory_film ( film_id ) ref film (film_id)
fk_inventory_store ( store_id ) ref store (store_id)


Table language

IndexesField NameData TypeDescription
* language_id tinyint DEFAULT (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_AA419FF8_25F5_43DD_BC48_4837520C03B1)
* name char( 20 )
* last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_9 ON language_id


Table payment

IndexesField NameData TypeDescription
* payment_id smallint DEFAULT (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_3AA7B3B6_06F1_4A38_9E91_64410B2988E9)
* customer_id smallint
* staff_id tinyint
rental_id integer
* amount decimal( 5 )
* payment_date timestamp
  last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_D ON payment_id
fk_payment_customer_INDEX_D ON customer_id
fk_payment_rental_INDEX_D ON rental_id
fk_payment_staff_INDEX_D ON staff_id
Foreign Keys
fk_payment_customer ( customer_id ) ref customer (customer_id)
fk_payment_rental ( rental_id ) ref rental (rental_id)
fk_payment_staff ( staff_id ) ref staff (staff_id)


Table rental

IndexesField NameData TypeDescription
* rental_id integer DEFAULT (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_34E11AA7_67CE_44AD_84D5_269AE16763EE)
* rental_date timestamp
* inventory_id integer
* customer_id smallint
  return_date timestamp
* staff_id tinyint
* last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_C8 ON rental_id
CONSTRAINT_INDEX_C ON rental_date, inventory_id, customer_id
fk_rental_customer_INDEX_C ON customer_id
fk_rental_inventory_INDEX_C ON inventory_id
fk_rental_staff_INDEX_C ON staff_id
Foreign Keys
fk_rental_customer ( customer_id ) ref customer (customer_id)
fk_rental_inventory ( inventory_id ) ref inventory (inventory_id)
fk_rental_staff ( staff_id ) ref staff (staff_id)


Table staff

IndexesField NameData TypeDescription
* staff_id tinyint DEFAULT (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_610519DD_8738_4474_9E37_D41878EF4B9E)
* first_name varchar( 45 )
* last_name varchar( 45 )
* address_id smallint
  picture blob( 2147483647 )
  email varchar( 50 )
* store_id tinyint
* active boolean DEFAULT TRUE
* username varchar( 16 )
  password varchar( 40 )
* last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_6 ON staff_id
fk_staff_address_INDEX_6 ON address_id
Foreign Keys
fk_staff_address ( address_id ) ref address (address_id)


Table store

IndexesField NameData TypeDescription
* store_id tinyint DEFAULT (NEXT VALUE FOR SAKILA.SYSTEM_SEQUENCE_77628EA6_6894_4132_88FC_1D9EF43F5EC5)
* manager_staff_id tinyint
* address_id smallint
* last_update timestamp DEFAULT CURRENT_TIMESTAMP()
Indexes
CONSTRAINT_68 ON store_id
fk_store_address_INDEX_6 ON address_id
fk_store_staff_INDEX_6 ON manager_staff_id
Foreign Keys
fk_store_address ( address_id ) ref address (address_id)
fk_store_staff ( manager_staff_id ) ref staff (staff_id)


View actor_info

Query


View customer_list

Query


View film_list

Query


View sales_by_film_category

Query


View sales_by_store

Query


View staff_list

Query

Powered by DbSchema