You are on page 1of 3

Question 1

CREATE TABLE FactSalesTransaction (


DateKey int NOT NULL,
ProductKey int NOT NULL,
PromotionKey int NOT NULL,
StoreKey int NOT NULL,
DollarSales number(10,2),
UnitSales number(10,2),
DollarCost number(10,2),
DollarGrossProfit number(10,2),
CONSTRAINT FK_FactSales_DimDate FOREIGN KEY (DateKey) references DimDate(DateKey),
CONSTRAINT FK_FactSales_DimProduct FOREIGN KEY (ProductKey) references
DimProduct(ProductKey),
CONSTRAINT FK_FactSales_DimPromotion FOREIGN KEY (PromotionKey) references
DimPromotion(PromotionKey),
CONSTRAINT FK_FactSales_DimStore FOREIGN KEY (StoreKey) references
DimStore(StoreKey)
);

Question 2
Select ProductName, Brand, PromotionName, Storename, SalesRegion, DollarSales, UnitSales
from
DATA_PRODUCT, DATA_PROMOTION, DATA_STORE, DATA_SALESTRANSACTIONS;
MALI AKO DITO KASI DAPAT PACIFIC NAKALAGAY SA SALESREGION EH KASO
EASTERN NAKALAGAY SA AKIN…

Question 3:
CREATE TABLE StoreInventorySnapshotFact (
SnapshotID INT GENERATED ALWAYS AS IDENTITY,
DateKey INT,
ProductKey INT,
StoreKey INT,
QuantityOnHand NUMBER(10, 2),
CONSTRAINT PK_StoreInventorySnapshotFact PRIMARY KEY (SnapshotID),
CONSTRAINT FK_StoreInventorySnapshotFact_DateKey FOREIGN KEY (DateKey)
REFERENCES DimDate (DateKey),
CONSTRAINT FK_StoreInventorySnapshotFact_ProductKey FOREIGN KEY (ProductKey)
REFERENCES DimProduct (ProductKey),
CONSTRAINT FK_StoreInventorySnapshotFact_StoreKey FOREIGN KEY (StoreKey)
REFERENCES DimStore (StoreKey)
);

SCREENSHOT LANG NG STAR SCHEMA ILALAGAY NA SAGOT


Question 4:
Mas madali question 4 unahin mo nalang to kasi mahirap ung 2, pwede ka mag number 3 agad
pag tapos mo na 1 then panghuli mo na num2 kase mahirap yon

You might also like