text: -- Creating DB Schema
  CREATE DATABASE IF NOT EXISTS DW_PROJECT;
  USE DW_PROJECT;
  
  -- Dropping Tables
  DROP TABLE IF EXISTS `TRANSACTIONS`;
  DROP TABLE IF EXISTS `PRODUCT`;
  DROP TABLE IF EXISTS `SUPPLIER`;
  DROP TABLE IF EXISTS `STORE`;
  DROP TABLE IF EXISTS `CUSTOMER`;
  DROP TABLE IF EXISTS `TIME`;
  
  -- Dimension Tables
  CREATE TABLE `PRODUCT` (
      `PRODUCT_ID`      VARCHAR(6) NOT NULL,
      `PRODUCT_NAME`    VARCHAR(30),
      CONSTRAINT `PRODUCT_PK` PRIMARY KEY (PRODUCT_ID)
  );
  
  CREATE TABLE `SUPPLIER` (
      `SUPPLIER_ID`   VARCHAR(5)  NOT NULL, 
      `SUPPLIER_NAME` VARCHAR(30) NOT NULL,
      CONSTRAINT `SUPPLIER_PK` PRIMARY KEY (SUPPLIER_ID)
  );
  
  CREATE TABLE `STORE` (
      `STORE_ID`      VARCHAR(4)  NOT NULL, 
      `STORE_NAME`    VARCHAR(20) NOT NULL,
      CONSTRAINT `STORE_PK` PRIMARY KEY (STORE_ID)
  );
  
  CREATE TABLE `CUSTOMER` (
      `CUSTOMER_ID`   VARCHAR(4)  NOT NULL, 
      `CUSTOMER_NAME` VARCHAR(30) NOT NULL,
      CONSTRAINT `CUSTOMER_PK` PRIMARY KEY (CUSTOMER_ID)
  );
  
  CREATE TABLE `TIME` (
      `TIME_ID`       DATE     NOT NULL,
      `DAY`           SMALLINT NOT NULL,
      `DAY_OF_WEEK`   SMALLINT NOT NULL,
      `MONTH`         SMALLINT NOT NULL,
      `QUARTER`       SMALLINT NOT NULL,
      `YEAR`          SMALLINT NOT NULL,
      CONSTRAINT `TIME_PK` PRIMARY KEY (TIME_ID)
  );
  
  -- Fact Table
  CREATE TABLE `TRANSACTIONS` (
      `PRODUCT_ID`        VARCHAR(6)  NOT NULL,
      `SUPPLIER_ID`       VARCHAR(5)  NOT NULL,
      `STORE_ID`          VARCHAR(4)  NOT NULL,
      `CUSTOMER_ID`       VARCHAR(4)  NOT NULL,
      `TIME_ID`           SMALLINT    NOT NULL,
      `QUANTITY`          SMALLINT    NOT NULL,
      `TOTAL_SALE`        FLOAT(7, 3) NOT NULL,
      CONSTRAINT `FK_PRODUCT`     FOREIGN KEY (PRODUCT_ID) REFERENCES PRODUCT(PRODUCT_ID),
      CONSTRAINT `FK_SUPPLIER`    FOREIGN KEY (SUPPLIER_ID) REFERENCES SUPPLIER(SUPPLIER_ID),
      CONSTRAINT `FK_STORE`       FOREIGN KEY (STORE_ID) REFERENCES STORE(STORE_ID),
      CONSTRAINT `FK_CUSTOMER`    FOREIGN KEY (CUSTOMER_ID) REFERENCES CUSTOMER(CUSTOMER_ID),
      CONSTRAINT `FK_TIME`        FOREIGN KEY (TIME_ID) REFERENCES `TIME`(TIME_ID)
  );
  