27_03_25_LibraryERD

Tables (7)

ISBN

  • ISBN (Key) — VARCHAR(20) — Primary key — NOT NULL — Intl Standard Book No
  • category_id (Key2) — VARCHAR(5) — Foreign key → category.category_id — NOT NULL
  • author (Field) — VARCHAR(100) — NOT NULL
  • publisher (Field2) — VARCHAR(100)
  • issue_date (Field3) — DATE
  • book_title (Field4) — VARCHAR(200) — NOT NULL

appendix

  • appendix_id (Key) — VARCHAR(15) — Primary key — NOT NULL
  • book_id (Key2) — VARCHAR(15) — Foreign key → book.book_id — NOT NULL
  • title (Field2) — VARCHAR(200) — NOT NULL

book (books)

  • book_id (Key) — VARCHAR(15) — Primary key — NOT NULL
  • ISBN (Key2) — VARCHAR(20) — Foreign key → ISBN.ISBN — NOT NULL — Intl Standard Book No
  • reservation_status (Field2) — VARCHAR(10) — NOT NULL

category

  • category_id (Key) — VARCHAR(5) — Primary key — NOT NULL
  • category_name (Field) — VARCHAR(20) — NOT NULL

loan (loans)

  • loan_id (Key) — BIGINT(15) — Primary key — NOT NULL
  • book_id (Key3) — VARCHAR(15) — Foreign key → book.book_id — NOT NULL
  • member_id (Key2) — BIGINT(10) — Foreign key → member.member_id — NOT NULL
  • loan_date (Field3) — DATE — NOT NULL
  • return_date (Field4) — DATE
  • appendix (Field5) — VARCHAR(5)
  • extend (Field6) — VARCHAR(5)

member

  • member_id (Key) — BIGINT(10) — Primary key — NOT NULL
  • member_name (Field) — VARCHAR(100) — NOT NULL
  • ic_no (Field2) — VARCHAR(20) — NOT NULL
  • grade (Field3) — VARCHAR(10) — NOT NULL
  • address (Field4) — VARCHAR(300) — NOT NULL
  • phone_no (Field5) — VARCHAR(15)
  • e-mail (Field6) — VARCHAR(200)

reservation

  • reservation_date (Key3) — DATETIME — Primary key — NOT NULL
  • member_id (Key) — BIGINT(10) — Foreign key → member.member_id — NOT NULL
  • book_id (Key2) — VARCHAR(20) — Foreign key → book.book_id — NOT NULL