maxshop

Tables (7)

ADDRESSES

  • addressId — INT — Primary key — NOT NULL
  • userId — VARCHAR(20) — Foreign key → USERS.userId — NOT NULL
  • address — VARCHAR(200)
  • createdAt — TIMESTAMP
  • updatedAt — TIMESTAMP

CARTS

  • cartId — INT — Primary key — NOT NULL
  • userId — VARCHAR(20) — Foreign key → USERS.userId — NOT NULL
  • productId — INT — Foreign key → PRODUCTS.productId — NOT NULL
  • createdAt (createAt) — TIMESTAMP
  • updatedAt — TIMESTAMP

CATEGORIES

  • categoryId — INT — Primary key — NOT NULL
  • categoryName — VARCHAR(20)

ORDERDETAILS

  • orderDetailId — INT — Primary key — NOT NULL
  • productCount — INT
  • deliveryStatus — ENUM
  • createdAt (createAt) — TIMESTAMP
  • orderId — INT — Foreign key → ORDERS.orderId — NOT NULL
  • productId — INT — Foreign key → PRODUCTS.productId — NOT NULL

ORDERS

  • orderId — INT — Primary key — NOT NULL
  • userId — VARCHAR(20) — Foreign key → USERS.userId — NOT NULL
  • totalPrice — INT
  • address — VARCHAR(200)
  • Field

PRODUCTS

  • productId — INT — Primary key — NOT NULL
  • productName — VARCHAR(20)
  • productPrice — INT
  • productStock — INT
  • productDescription — VARCHAR(255)
  • productStatus — ENUM
  • createdAt — TIMESTAMP
  • updatedAt — TIMESTAMP
  • categoryId — INT — Foreign key → CATEGORIES.categoryId — NOT NULL

USERS

  • userId — VARCHAR(20) — Primary key — NOT NULL
  • password — VARCHAR(20)
  • userName — VARCHAR(20)
  • phoneNumber — VARCHAR(20)
  • birthday — DATE
  • isAdmin — CHAR(1)
  • gender — ENUM
  • createdAt (createAt) — TIMESTAMP
  • updatedAt — TIMESTAMP