sakila

테이블 (16)

결재 (payment)

  • payment_id (PK) — int — 기본 키 — NOT NULL — auto_increment
  • amount (가격) — decimal — NOT NULL
  • payment_date (결재 일자) — datetime — NOT NULL
  • last_update (마지막 업데이트 날짜) — Instant — on update current_timestamp
  • customer_id (손님 PK) — int — 외래 키 → 손님.customer_id — NOT NULL — 외래키
  • staff_id (스태프 PK) — int — 외래 키 → 스태프.staff_id — NOT NULL — 외래키
  • rental_id (대여 PK) — int — 외래 키 → 대여.rental_id — NOT NULL — 외래키

국가 (country)

  • country_id (PK) — int — 기본 키 — NOT NULL — auto_increment
  • country (국가명) — String — NOT NULL
  • last_update (마지막 업데이트 날짜) — Instant — NOT NULL — on update current_timestamp

대여 (rental)

  • rental_id (PK) — int — 기본 키 — NOT NULL — auto_increment
  • rental_date (대여일자) — datetime — NOT NULL
  • return_date (반납일자) — datetime
  • last_update (마지막 업데이트 날짜) — Instant — on update current_timestamp
  • customer_id (손님 PK) — int — 외래 키 → 손님.customer_id — NOT NULL — 외래키
  • staff_id (스태프 PK) — int — 외래 키 → 스태프.staff_id — NOT NULL — 외래키

도시 (city)

  • city_id (PK) — int — 기본 키 — NOT NULL — auto_increment
  • city (도시명) — String — NOT NULL
  • last_update (마지막 업데이트 날짜) — Instant — NOT NULL — on update current_timestamp
  • country_id (국가 PK) — int — 외래 키 → 국가.country_id — NOT NULL — 외래키

배우 (actor)

  • actor_id (PK) — int — 기본 키 — NOT NULL — auto_increment
  • first_name (성) — String — NOT NULL
  • last_name (이름) — String — NOT NULL
  • last_update (마지막 업데이트 날짜) — Instant — NOT NULL — on update current_timestamp

상점 (store)

  • store_id (PK) — int — 기본 키 — NOT NULL — auto_increment
  • last_update (마지막 업데이트 날짜) — Instant — NOT NULL — on update current_timestamp
  • address_id (주소 PK) — int — 외래 키 → 주소.address_id — NOT NULL — 외래키
  • manager_staff_id (점장 스태프 PK) — int — 외래 키 → 스태프.staff_id — NOT NULL — 외래키

손님 (customer)

  • customer_id (PK) — int — 기본 키 — NOT NULL — auto_increment
  • first_name (성) — String — NOT NULL
  • last_name (이름) — String — NOT NULL
  • email (이메일) — String
  • active (활성 상태) — boolean — NOT NULL
  • create_date (가입일) — datetime — NOT NULL
  • last_update (마지막 업데이트 날짜) — Instant — on update current_timestamp
  • address_id (주소 PK) — int — 외래 키 → 주소.address_id — NOT NULL — 외래키
  • store_id (상점 PK) — int — 외래 키 → 상점.store_id — NOT NULL — 외래키

스태프 (staff)

  • staff_id (PK) — int — 기본 키 — NOT NULL — auto_increment
  • first_name (성) — String — NOT NULL
  • last_name (이름) — String — NOT NULL
  • picture (프로필) — blob
  • email (이메일) — String
  • active (활성 상태) — boolean — NOT NULL
  • username (아이디) — String — NOT NULL
  • password (비밀번호) — String
  • last_update (마지막 업데이트 날짜) — Instant — NOT NULL — on update current_timestamp
  • store_id (상점 PK) — int — 외래 키 → 상점.store_id — NOT NULL — 외래키
  • address_id (주소 PK) — int — 외래 키 → 주소.address_id — NOT NULL — 왜래키

언어 (language)

  • language_id (PK) — int — 기본 키 — NOT NULL — auto_increment
  • name (이름) — String — NOT NULL
  • last_update (마지막 업데이트 날짜) — Instant — NOT NULL — on update current_timestamp

영화 (film)

  • film_id (PK) — int — 기본 키 — NOT NULL — auto_increment
  • title (제목) — String — NOT NULL
  • description (설명) — String
  • release_year (개봉 연도) — Year
  • rental_duration (대여 가능 기간) — int — NOT NULL
  • retal_rate (대여비) — decimal — NOT NULL
  • length (영화 상영 시간) — int
  • replacement_cost (분실/파손 교체 비용) — decimal — NOT NULL
  • rating (관람 등급) — enum
  • special_features (특수 기능) — EnumSet — NOT NULL
  • last_update (마지막 업데이트 날짜) — Instant — NOT NULL — on update current_timestamp
  • language_id (언어 PK) — int — 외래 키 → 언어.language_id — NOT NULL — 외래키
  • original_language_id (언어 PK(원어)) — int — 외래 키 → 언어.language_id — 외래키

영화 배우 (film_actor)

  • actor_id (PK) — int — 외래 키 → 배우.actor_id — NOT NULL — actor PK
  • film_id (PK2) — int — 외래 키 → 영화.film_id — NOT NULL — film PK
  • last_update (마지막 업데이트 날짜) — Instant — NOT NULL — on update current_timestamp

영화 카테고리 (film_category)

  • film_id (PK) — int — 외래 키 → 영화.film_id — NOT NULL — film PK
  • category_id (PK2) — int — 외래 키 → 카테고리.category_id — NOT NULL — category PK
  • last_update (마지막 업데이트 날짜) — Instant — NOT NULL — on update current_timestamp

영화 텍스트 검색 (film_text)

  • film_id (PK) — int — 외래 키 → 영화.film_id — NOT NULL — film PK
  • title (제목) — String — NOT NULL
  • description (설명) — String

재고 (inventory)

  • inventory_id (PK) — int — 기본 키 — NOT NULL — auto_increment
  • last_update (마지막 업데이트 날짜) — Instant — NOT NULL — on update current_timestamp
  • store_id (상점 PK) — int — 외래 키 → 상점.store_id — NOT NULL — 외래키
  • film_id (영화 PK) — int — 외래 키 → 영화.film_id — NOT NULL — 외래키

주소 (address)

  • address_id (PK) — int — 기본 키 — NOT NULL — auto_increment
  • address (주소) — String — NOT NULL
  • address2 (상세 주소) — String
  • district (주) — String — NOT NULL
  • postal_code (우편주소 코드) — String
  • phone (핸드폰 번호) — String — NOT NULL
  • location (좌표) — BLOB — NOT NULL
  • last_update (마지막 업데이트 날짜) — Instant — NOT NULL — on update current_timestamp
  • city_id (도시 PK) — int — 외래 키 → 도시.city_id — NOT NULL — 외래키

카테고리 (category)

  • category_id (PK) — int — 기본 키 — NOT NULL — auto_increment
  • name (카테고리명) — NOT NULL
  • last_update (마지막 업데이트 날짜) — Instant — NOT NULL — on update current_timestamp