Trying to do a fact and dim table in Sql
0
votes
0
answers
62
views
so far this is what i have code wise, but im getting an error 1239 . Is it not referencing something correctly .
CREATE TABLE CustomerDim
(
C_CustomerID_Cu INT(10) NOT NULL,
C_FacilityReservationNumber_Cu INT(10) NOT NULL,
I_EventCode_Cu INT(10) NOT NULL,
CONSTRAINT C_CustomerID_Cu FOREIGN KEY (C_CustomerID_Cu)
REFERENCES CustomerDIM
);
CREATE TABLE RoomDim
(
C_RoomNumber_Ro INT(10) NOT NULL,
C_RoomType_Ro INT(5) NOT NULL,
C_RegionID_Re INT(4) NOT NULL,
C__ResortCode_Fa INT(10) NOT NULL,
CONSTRAINTC_RoomNumber_Ro FOREIGN KEY(C_RoomType_Ro)
refereREFERENCES nces RoomDIM
);
CREATE TABLE ReservationFact
(
C_RoomReservationNumber_Rr INT (10) NOT NULL,
C_CustomerID_Cu INT (10) NOT NULL,
C__RoomType_Ro INT (10) NOT NULL,
C_D_ArrivalDate_Rr DATE,
C_EmployeeNumber_Em INT (5) NOT NULL
C_ResortCode_Rs INT (10),
CONSTRAINT C_RoomReservationNumber_Rr_pk PRIMARY KEY
(C_RoomReservationNumber_Rr)
);
Asked by masongirl
(1 rep)
Mar 30, 2020, 07:31 PM
Last activity: Mar 30, 2020, 09:35 PM
Last activity: Mar 30, 2020, 09:35 PM