BIZ587_Assignment#1

테이블 (8)

가맹점 (merchant)

  • 가맹점ID (id) — string — 기본 키 — NOT NULL
  • 가맹점명 (name) — string — NOT NULL
  • 브랜드ID (brand_id) — string — 외래 키 → 브랜드.브랜드ID — NOT NULL
  • 가맹점카테고리ID (merchant_category_id) — string — 외래 키 → 가맹점카테고리.가맹점카테고리ID
  • 상태 (status) — string — NOT NULL
  • 주소 (address) — string
  • 전화번호 (phone_number) — string
  • 등록일시 (created_at) — timestamp — NOT NULL
  • 수정일시 (updated_at) — timestamp

가맹점카테고리 (merchant_category)

  • 가맹점카테고리ID (id) — string — 기본 키 — NOT NULL
  • 가맹점카테고리명 (name) — string — NOT NULL
  • 등록일시 (created_at) — timestamp — NOT NULL
  • 수정일시 (Field3) — timestamp

결제 이력 (payment_history)

  • 결제이력ID (id) — bigint — 기본 키 — NOT NULL
  • 고객카드보유ID (customer_card_id) — bigint — 외래 키 → 고객 카드 보유 정보.고객카드보유ID — NOT NULL
  • 가맹점ID (merchant_id) — string — 외래 키 → 가맹점.가맹점ID — NOT NULL
  • 결제금액 (amount) — decimal — NOT NULL
  • 결제 상태 (status) — string — NOT NULL
  • 결제일시 (paid_at) — timestamp — NOT NULL

고객 (customer)

  • 고객ID (id) — string — 기본 키 — NOT NULL
  • 고객명 (name) — string — NOT NULL
  • 나이 (age) — int
  • 성별 (gender) — string
  • 가입일시 (joined_at) — timestamp — NOT NULL

고객 카드 보유 정보 (customer_card)

  • 고객카드보유ID (id) — bigint — 기본 키 — NOT NULL
  • 고객ID (customer_id) — string — 외래 키 → 고객.고객ID — NOT NULL
  • 카드ID (card_id) — string — 외래 키 → 카드.카드ID — NOT NULL
  • 카드번호 (card_number) — string — NOT NULL
  • 유효기간 (expiry_date) — string — NOT NULL
  • 카드상태 (status) — boolean — NOT NULL
  • 생성일시 (created_at) — timestamp — NOT NULL
  • 수정일시 (updated_at) — timestamp

브랜드 (brand)

  • 브랜드ID (id) — string — 기본 키 — NOT NULL
  • 브랜드명 (name) — string — NOT NULL
  • 등록일시 (created_at) — timestamp — NOT NULL
  • 수정일시 (updated_at) — timestamp

카드 (card)

  • 카드ID (id) — string — 기본 키 — NOT NULL
  • 카드명 (name) — string — NOT NULL
  • 카드사명 (company) — string — NOT NULL
  • 카드유형 (type) — string — NOT NULL
  • 연회비 (annual_fee) — decimal — NOT NULL
  • 계약기간(월) (contract_period_months) — int — NOT NULL
  • 등록일시 (created_at) — timestamp — NOT NULL
  • 수정일시 (updated_at) — timestamp

카드혜택 (card_benefit)

  • 카드혜택ID (id) — string — 기본 키 — NOT NULL
  • 카드ID (card_id) — string — 외래 키 → 카드.카드ID — NOT NULL
  • 브랜드ID (brand_id) — string — 외래 키 → 브랜드.브랜드ID — NOT NULL
  • 가맹점카테고리ID (merchant_category_id) — string — 외래 키 → 가맹점카테고리.가맹점카테고리ID — NOT NULL
  • 할인금액 (discount_amount) — decimal
  • 마일리지 적립률 (mileage_rate) — float
  • 월간 혜택 상한선 (monthly limit) — decimal
  • 등록일시 (created_at) — timestamp — NOT NULL
  • 수정일시 (updated_at) — timestamp